Changeset e2574afbe in vaadin
- Timestamp:
- 12/22/11 13:15:52 (17 months ago)
- Branches:
- 20b169873dbacf9eb7135a861bc5cf15177225ee, 7.0, 7.1
- Children:
- a90834512
- Parents:
- a614a722e
- git-author:
- Marc Englund <marc@…> (12/22/11 12:51:46)
- git-committer:
- Marc Englund <marc@…> (12/22/11 13:15:52)
- Location:
- src/com/vaadin/terminal/gwt/server
- Files:
-
- 1 added
- 2 edited
-
AbstractCommunicationManager.java (modified) (1 diff)
-
BootstrapHandler.java (modified) (3 diffs)
-
UnsupportedBrowserHandler.java (added)
Legend:
- Unmodified
- Added
- Removed
-
src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
r0cc29722 re2574afbe 188 188 application.addRequestHandler(getBootstrapHandler()); 189 189 application.addRequestHandler(APP_RESOURCE_HANDLER); 190 application.addRequestHandler(UnsupportedBrowserHandler.getInstance()); 190 191 requireLocale(application.getLocale().toString()); 191 192 } -
src/com/vaadin/terminal/gwt/server/BootstrapHandler.java
r0cc29722 re2574afbe 27 27 public abstract class BootstrapHandler implements RequestHandler { 28 28 29 /** Cookie used to ignore browser checks */30 private static final String FORCE_LOAD_COOKIE = "vaadinforceload=1";31 32 29 protected class BootstrapContext implements Serializable { 30 33 31 private final WrappedResponse response; 34 32 private final WrappedRequest request; … … 118 116 throws IOException { 119 117 120 if (request.getBrowserDetails() != null) {121 // Check if the browser is supported; we'll activate Chrome Frame122 // silently if available.123 WebBrowser b = request.getBrowserDetails().getWebBrowser();124 if (b.isTooOldToFunctionProperly() && !b.isChromeFrameCapable()) {125 // bypass if cookie set126 String c = request.getHeader("Cookie");127 if (c == null || !c.contains(FORCE_LOAD_COOKIE)) {128 writeBrowserTooOldPage(request, response);129 return true;130 }131 132 }133 }134 135 118 // TODO Should all urls be handled here? 136 119 int rootId; … … 154 137 155 138 return true; 156 }157 158 /**159 * Writes a page encouraging the user to upgrade to a more current browser.160 *161 * @param request162 * @param response163 * @throws IOException164 */165 protected void writeBrowserTooOldPage(WrappedRequest request,166 WrappedResponse response) throws IOException {167 Writer page = response.getWriter();168 WebBrowser b = request.getBrowserDetails().getWebBrowser();169 170 page.write("<html><body><h1>I'm sorry, but your browser is not supported</h1>"171 + "<p>The version ("172 + b.getBrowserMajorVersion()173 + "."174 + b.getBrowserMinorVersion()175 + ") of the browser you are using "176 + " is outdated and not supported.</p>"177 + "<p>You should <b>consider upgrading</b> to a more up-to-date browser.</p> "178 + "<p>The most popular browsers are <b>"179 + " <a href=\"https://www.google.com/chrome\">Chrome</a>,"180 + " <a href=\"http://www.mozilla.com/firefox\">Firefox</a>,"181 + (b.isWindows() ? " <a href=\"http://windows.microsoft.com/en-US/internet-explorer/downloads/ie\">Internet Explorer</a>,"182 : "")183 + " <a href=\"http://www.opera.com/browser\">Opera</a>"184 + " and <a href=\"http://www.apple.com/safari\">Safari</a>.</b><br/>"185 + "Upgrading to the latest version of one of these <b>will make the web safer, faster and better looking.</b></p>"186 + (b.isIE() ? "<script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js\"></script>"187 + "<p>If you can not upgrade your browser, please consider trying <a onclick=\"CFInstall.check({mode:'overlay'});return false;\" href=\"http://www.google.com/chromeframe\">Chrome Frame</a>.</p>"188 : "") //189 + "<p><sub><a onclick=\"document.cookie='"190 + FORCE_LOAD_COOKIE191 + "';window.location.reload();return false;\" href=\"#\">Continue without updating</a> (not recommended)</sub></p>"192 + "</body>\n" + "</html>");193 194 page.close();195 139 } 196 140
Note: See TracChangeset
for help on using the changeset viewer.
