]> source.dussan.org Git - vaadin-framework.git/commitdiff
Remove clientHeight/Width from WebBrowser (#5655)
authorLeif Åstrand <leif@vaadin.com>
Tue, 22 May 2012 13:07:32 +0000 (13:07 +0000)
committerLeif Åstrand <leif@vaadin.com>
Tue, 22 May 2012 13:07:32 +0000 (13:07 +0000)
svn changeset:23792/svn branch:6.8

src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java
src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java
src/com/vaadin/terminal/gwt/server/WebBrowser.java
tests/testbench/com/vaadin/tests/application/WebBrowserSizeTest.java

index 2ac574c2de6e0ab946e5acd82d34e49233f0a4a8..0a8e9530f077e1a2e0cc94fe4168e73496910d4d 100644 (file)
@@ -578,8 +578,6 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
             browser.updateClientSideDetails(
                     getHTTPRequestParameter(request, "sw"),
                     getHTTPRequestParameter(request, "sh"),
-                    getHTTPRequestParameter(request, "cw"),
-                    getHTTPRequestParameter(request, "ch"),
                     getHTTPRequestParameter(request, "tzo"),
                     getHTTPRequestParameter(request, "rtzo"),
                     getHTTPRequestParameter(request, "dstd"),
index 68089e18e031f32d842a6469f881ccf649478968..54ea4a94ed8332e1c3dbc26594b56eb4d8c9cc2d 100644 (file)
@@ -603,8 +603,7 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements
                 request.getHeader("user-agent"));
         if (request.getParameter("repaintAll") != null) {
             browser.updateClientSideDetails(request.getParameter("sw"),
-                    request.getParameter("sh"), request.getParameter("cw"),
-                    request.getParameter("ch"), request.getParameter("tzo"),
+                    request.getParameter("sh"), request.getParameter("tzo"),
                     request.getParameter("rtzo"), request.getParameter("dstd"),
                     request.getParameter("dston"),
                     request.getParameter("curdate"),
index a57a4c65d2223170977c5ea57705d51ff1b6be7c..9182ebdc03cc1a43c098d5e6b8b4d8d7e06fbe4a 100644 (file)
@@ -22,8 +22,6 @@ public class WebBrowser implements Terminal {
 
     private int screenHeight = 0;
     private int screenWidth = 0;
-    private int clientHeight = 0;
-    private int clientWidth = 0;
     private String browserApplication = null;
     private Locale locale;
     private String address;
@@ -64,30 +62,6 @@ public class WebBrowser implements Terminal {
         return screenWidth;
     }
 
-    /**
-     * Gets the height of the client (browser window).
-     * <p>
-     * Note that the client size is only updated on a full repaint, not when the
-     * browser window size changes
-     * 
-     * @return The height of the client or 0 if unknown.
-     */
-    public int getClientHeight() {
-        return clientHeight;
-    }
-
-    /**
-     * Gets the width of the client (browser window)
-     * <p>
-     * Note that the client size is only updated on a full repaint, not when the
-     * browser window size changes
-     * 
-     * @return The width of the client or 0 if unknown.
-     */
-    public int getClientWidth() {
-        return clientWidth;
-    }
-
     /**
      * Get the browser user-agent string.
      * 
@@ -338,10 +312,6 @@ public class WebBrowser implements Terminal {
      *            Screen width
      * @param sh
      *            Screen height
-     * @param cw
-     *            Client width
-     * @param ch
-     *            Client height
      * @param tzo
      *            TimeZone offset in minutes from GMT
      * @param rtzo
@@ -354,9 +324,9 @@ public class WebBrowser implements Terminal {
      *            the current date in milliseconds since the epoch
      * @param touchDevice
      */
-    void updateClientSideDetails(String sw, String sh, String cw, String ch,
-            String tzo, String rtzo, String dstSavings, String dstInEffect,
-            String curDate, boolean touchDevice) {
+    void updateClientSideDetails(String sw, String sh, String tzo, String rtzo,
+            String dstSavings, String dstInEffect, String curDate,
+            boolean touchDevice) {
         if (sw != null) {
             try {
                 screenHeight = Integer.parseInt(sh);
@@ -365,14 +335,6 @@ public class WebBrowser implements Terminal {
                 screenHeight = screenWidth = 0;
             }
         }
-        if (cw != null) {
-            try {
-                clientHeight = Integer.parseInt(ch);
-                clientWidth = Integer.parseInt(cw);
-            } catch (final NumberFormatException e) {
-                clientHeight = clientWidth = 0;
-            }
-        }
         if (tzo != null) {
             try {
                 // browser->java conversion: min->ms, reverse sign
index eacf2a0e532c6025e504e3206736ca234ae519c1..a3f11f2cd3b8ac9b6b89e8f3f9723233d2325f50 100644 (file)
@@ -21,8 +21,10 @@ public class WebBrowserSizeTest extends TestBase {
             public void buttonClick(ClickEvent event) {
                 screenSizeLabel.setValue(getBrowser().getScreenWidth() + " x "
                         + getBrowser().getScreenHeight());
-                browserSizeLabel.setValue(getBrowser().getClientWidth() + " x "
-                        + getBrowser().getClientHeight());
+                browserSizeLabel.setValue(getMainWindow()
+                        .getBrowserWindowWidth()
+                        + " x "
+                        + getMainWindow().getBrowserWindowHeight());
             }
         });