Bug 1224403 (part 9) - Remove GetRestoredBoundsUntyped(). r=kats.
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 12 Nov 2015 05:43:01 -0800
changeset 308737 2b32dd022204978ced3dc039b432caf387f295de
parent 308736 c7bddc993c53e9beefdd7995dfd195576e54faf2
child 308738 3bf56b21189d3443b935eaf1993a389492701f14
push id7515
push usermjzffr@gmail.com
push dateFri, 13 Nov 2015 14:42:42 +0000
reviewerskats
bugs1224403
milestone45.0a1
Bug 1224403 (part 9) - Remove GetRestoredBoundsUntyped(). r=kats. The typed version can be used everywhere without difficulty.
widget/nsBaseWidget.cpp
widget/nsBaseWidget.h
widget/nsIWidget.h
widget/windows/nsWindow.cpp
widget/windows/nsWindow.h
--- a/widget/nsBaseWidget.cpp
+++ b/widget/nsBaseWidget.cpp
@@ -1327,22 +1327,22 @@ NS_METHOD nsBaseWidget::GetBoundsUntyped
 * this method must be overridden
 *
 **/
 NS_METHOD nsBaseWidget::GetScreenBoundsUntyped(nsIntRect &aRect)
 {
   return GetBoundsUntyped(aRect);
 }
 
-NS_METHOD nsBaseWidget::GetRestoredBoundsUntyped(nsIntRect &aRect)
+NS_METHOD nsBaseWidget::GetRestoredBounds(LayoutDeviceIntRect &aRect)
 {
   if (SizeMode() != nsSizeMode_Normal) {
     return NS_ERROR_FAILURE;
   }
-  return GetScreenBoundsUntyped(aRect);
+  return GetScreenBounds(aRect);
 }
 
 nsIntPoint
 nsBaseWidget::GetClientOffsetUntyped()
 {
   return nsIntPoint(0, 0);
 }
 
--- a/widget/nsBaseWidget.h
+++ b/widget/nsBaseWidget.h
@@ -185,17 +185,17 @@ public:
     return mWindowType <= eWindowType_popup;
   }
   NS_IMETHOD              MoveClient(double aX, double aY) override;
   NS_IMETHOD              ResizeClient(double aWidth, double aHeight, bool aRepaint) override;
   NS_IMETHOD              ResizeClient(double aX, double aY, double aWidth, double aHeight, bool aRepaint) override;
   NS_IMETHOD              GetBoundsUntyped(nsIntRect &aRect) override;
   NS_IMETHOD              GetClientBoundsUntyped(nsIntRect &aRect) override;
   NS_IMETHOD              GetScreenBoundsUntyped(nsIntRect &aRect) override;
-  NS_IMETHOD              GetRestoredBoundsUntyped(nsIntRect &aRect) override;
+  NS_IMETHOD              GetRestoredBounds(mozilla::LayoutDeviceIntRect &aRect) override;
   NS_IMETHOD              GetNonClientMargins(
                             mozilla::LayoutDeviceIntMargin &margins) override;
   NS_IMETHOD              SetNonClientMargins(
                             mozilla::LayoutDeviceIntMargin &margins) override;
   virtual nsIntPoint      GetClientOffsetUntyped() override;
   NS_IMETHOD              EnableDragDrop(bool aEnable) override;
   NS_IMETHOD              GetAttention(int32_t aCycleCount) override;
   virtual bool            HasPendingInputEvent() override;
--- a/widget/nsIWidget.h
+++ b/widget/nsIWidget.h
@@ -838,29 +838,20 @@ class nsIWidget : public nsISupports {
      * Similar to GetScreenBounds except that this function will always
      * get the size when the widget is in the nsSizeMode_Normal size mode
      * even if the current size mode is not nsSizeMode_Normal.
      * This method will fail if the size mode is not nsSizeMode_Normal and
      * the platform doesn't have the ability.
      * This method will always succeed if the current size mode is
      * nsSizeMode_Normal.
      *
-     * The untyped version exists temporarily to ease conversion to typed
-     * coordinates.
-     *
      * @param aRect   On return it holds the  x, y, width and height of
      *                this widget.
      */
-    NS_IMETHOD GetRestoredBounds(mozilla::LayoutDeviceIntRect &aRect) {
-      nsIntRect tmp;
-      nsresult rv = GetRestoredBoundsUntyped(tmp);
-      aRect = mozilla::LayoutDeviceIntRect::FromUnknownRect(tmp);
-      return rv;
-    }
-    NS_IMETHOD GetRestoredBoundsUntyped(nsIntRect &aRect) = 0;
+    NS_IMETHOD GetRestoredBounds(mozilla::LayoutDeviceIntRect &aRect) = 0;
 
     /**
      * Get this widget's client area bounds, if the window has a 3D border
      * appearance this returns the area inside the border. The position is the
      * position of the client area relative to the client area of the parent
      * widget (for root widgets and popup widgets it is in screen coordinates).
      *
      * The untyped version exists temporarily to ease conversion to typed
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -1962,20 +1962,20 @@ NS_METHOD nsWindow::GetScreenBoundsUntyp
     aRect.x = r.left;
     aRect.y = r.top;
   } else
     aRect = mBounds;
 
   return NS_OK;
 }
 
-NS_METHOD nsWindow::GetRestoredBoundsUntyped(nsIntRect &aRect)
+NS_METHOD nsWindow::GetRestoredBounds(LayoutDeviceIntRect &aRect)
 {
   if (SizeMode() == nsSizeMode_Normal) {
-    return GetScreenBoundsUntyped(aRect);
+    return GetScreenBounds(aRect);
   }
   if (!mWnd) {
     return NS_ERROR_FAILURE;
   }
 
   WINDOWPLACEMENT pl = { sizeof(WINDOWPLACEMENT) };
   VERIFY(::GetWindowPlacement(mWnd, &pl));
   const RECT& r = pl.rcNormalPosition;
--- a/widget/windows/nsWindow.h
+++ b/widget/windows/nsWindow.h
@@ -113,17 +113,17 @@ public:
                                           int32_t aVertical);
   NS_IMETHOD              PlaceBehind(nsTopLevelWidgetZPlacement aPlacement, nsIWidget *aWidget, bool aActivate);
   NS_IMETHOD              SetSizeMode(nsSizeMode aMode);
   NS_IMETHOD              Enable(bool aState);
   virtual bool            IsEnabled() const;
   NS_IMETHOD              SetFocus(bool aRaise);
   NS_IMETHOD              GetBoundsUntyped(nsIntRect &aRect);
   NS_IMETHOD              GetScreenBoundsUntyped(nsIntRect &aRect);
-  NS_IMETHOD              GetRestoredBoundsUntyped(nsIntRect &aRect) override;
+  NS_IMETHOD              GetRestoredBounds(mozilla::LayoutDeviceIntRect &aRect) override;
   NS_IMETHOD              GetClientBoundsUntyped(nsIntRect &aRect);
   virtual nsIntPoint      GetClientOffsetUntyped() override;
   void                    SetBackgroundColor(const nscolor &aColor);
   NS_IMETHOD              SetCursor(imgIContainer* aCursor,
                                     uint32_t aHotspotX, uint32_t aHotspotY);
   NS_IMETHOD              SetCursor(nsCursor aCursor);
   virtual nsresult        ConfigureChildren(const nsTArray<Configuration>& aConfigurations);
   virtual bool PrepareForFullscreenTransition(nsISupports** aData) override;