Bug 1129774. Part 4: Remove aContext parameter from AttachViewToTopLevel. r=jmathies draft
authorRobert O'Callahan <robert@ocallahan.org>
Thu, 05 Feb 2015 18:33:49 +1300
changeset 241008 8f489db48c1239cafcf9b023e93def0a14506622
parent 241007 165ad0538aa7d03a2dcaa100221bb795cda40ac0
child 241009 e3a5382708f04c3dd2960744b22279be35c94663
push id566
push userrocallahan@mozilla.com
push dateThu, 05 Feb 2015 05:39:41 +0000
reviewersjmathies
bugs1129774
milestone38.0a1
Bug 1129774. Part 4: Remove aContext parameter from AttachViewToTopLevel. r=jmathies
view/nsView.cpp
widget/nsBaseWidget.cpp
widget/nsBaseWidget.h
widget/nsIWidget.h
--- a/view/nsView.cpp
+++ b/view/nsView.cpp
@@ -692,21 +692,19 @@ nsresult nsView::AttachToTopLevelWidget(
   nsIWidgetListener* listener = aWidget->GetAttachedWidgetListener();
   if (listener) {
     nsView *oldView = listener->GetView();
     if (oldView) {
       oldView->DetachFromTopLevelWidget();
     }
   }
 
-  nsRefPtr<nsDeviceContext> dx = mViewManager->GetDeviceContext();
-
   // Note, the previous device context will be released. Detaching
   // will not restore the old one.
-  nsresult rv = aWidget->AttachViewToTopLevel(!nsIWidget::UsePuppetWidgets(), dx);
+  nsresult rv = aWidget->AttachViewToTopLevel(!nsIWidget::UsePuppetWidgets());
   if (NS_FAILED(rv))
     return rv;
 
   mWindow = aWidget;
   NS_ADDREF(mWindow);
 
   mWindow->SetAttachedWidgetListener(this);
   mWindow->EnableDragDrop(true);
--- a/widget/nsBaseWidget.cpp
+++ b/widget/nsBaseWidget.cpp
@@ -323,18 +323,17 @@ nsBaseWidget::CreateChild(const nsIntRec
     return widget.forget();
   }
 
   return nullptr;
 }
 
 // Attach a view to our widget which we'll send events to.
 NS_IMETHODIMP
-nsBaseWidget::AttachViewToTopLevel(bool aUseAttachedEvents,
-                                   nsDeviceContext *aContext)
+nsBaseWidget::AttachViewToTopLevel(bool aUseAttachedEvents)
 {
   NS_ASSERTION((mWindowType == eWindowType_toplevel ||
                 mWindowType == eWindowType_dialog ||
                 mWindowType == eWindowType_invisible ||
                 mWindowType == eWindowType_child),
                "Can't attach to window of that type");
 
   mUseAttachedEvents = aUseAttachedEvents;
--- a/widget/nsBaseWidget.h
+++ b/widget/nsBaseWidget.h
@@ -210,17 +210,17 @@ public:
                                                          double aOriginalDeltaY,
                                                          double& aOverriddenDeltaX,
                                                          double& aOverriddenDeltaY) MOZ_OVERRIDE;
   virtual already_AddRefed<nsIWidget>
   CreateChild(const nsIntRect  &aRect,
               nsDeviceContext *aContext,
               nsWidgetInitData *aInitData = nullptr,
               bool             aForceUseIWidgetParent = false) MOZ_OVERRIDE;
-  NS_IMETHOD              AttachViewToTopLevel(bool aUseAttachedEvents, nsDeviceContext *aContext) MOZ_OVERRIDE;
+  NS_IMETHOD              AttachViewToTopLevel(bool aUseAttachedEvents) MOZ_OVERRIDE;
   virtual nsIWidgetListener* GetAttachedWidgetListener() MOZ_OVERRIDE;
   virtual void               SetAttachedWidgetListener(nsIWidgetListener* aListener) MOZ_OVERRIDE;
   NS_IMETHOD              RegisterTouchWindow() MOZ_OVERRIDE;
   NS_IMETHOD              UnregisterTouchWindow() MOZ_OVERRIDE;
   NS_IMETHOD_(TextEventDispatcher*) GetTextEventDispatcher() MOZ_OVERRIDE MOZ_FINAL;
 
   void NotifyWindowDestroyed();
   void NotifySizeMoveDone();
--- a/widget/nsIWidget.h
+++ b/widget/nsIWidget.h
@@ -826,20 +826,18 @@ class nsIWidget : public nsISupports {
      * context. The primary widget listener will continue to be called for
      * notifications relating to the top-level window, whereas other
      * notifications such as painting and events will instead be called via
      * the attached listener. SetAttachedWidgetListener should be used to
      * assign the attached listener.
      *
      * aUseAttachedEvents if true, events are sent to the attached listener
      * instead of the normal listener.
-     * aContext The new device context for the view
      */
-    NS_IMETHOD AttachViewToTopLevel(bool aUseAttachedEvents,
-                                    nsDeviceContext *aContext) = 0;
+    NS_IMETHOD AttachViewToTopLevel(bool aUseAttachedEvents) = 0;
 
     /**
      * Accessor functions to get and set the attached listener. Used by
      * nsView in connection with AttachViewToTopLevel above.
      */
     virtual void SetAttachedWidgetListener(nsIWidgetListener* aListener) = 0;
     virtual nsIWidgetListener* GetAttachedWidgetListener() = 0;