Commit e1f872d6 authored by Gijs Kruitbosch's avatar Gijs Kruitbosch
Browse files

Bug 1544167 - end drag sessions when creating dialog chrome windows, r=smaug

parent 6a9f236b
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@
#include "mozilla/dom/BrowsingContextGroup.h"
#include "mozilla/dom/Document.h"
#include "mozilla/dom/DocumentInlines.h"
#include "nsIDragService.h"
#include "nsIDOMChromeWindow.h"
#include "nsIPrompt.h"
#include "nsIScriptObjectPrincipal.h"
@@ -415,6 +416,14 @@ nsresult nsWindowWatcher::CreateChromeWindow(nsIWebBrowserChrome* aParentChrome,
  }

  bool cancel = false;
  if (aChromeFlags & nsIWebBrowserChrome::CHROME_OPENAS_DIALOG) {
    // If there are any drag and drop operations in flight, try to end them.
    nsCOMPtr<nsIDragService> ds =
        do_GetService("@mozilla.org/widget/dragservice;1");
    if (ds) {
      ds->EndDragSession(true, 0);
    }
  }
  nsCOMPtr<nsIWebBrowserChrome> newWindowChrome;
  nsresult rv = mWindowCreator->CreateChromeWindow(
      aParentChrome, aChromeFlags, aOpenWindowInfo, &cancel,
+3 −4
Original line number Diff line number Diff line
@@ -105,10 +105,9 @@ class nsWindowWatcher : public nsIWindowWatcher,
      const mozilla::Maybe<float>& aOpenerFullZoom = mozilla::Nothing());

 private:
  nsresult CreateChromeWindow(nsIWebBrowserChrome* aParentChrome,
                              uint32_t aChromeFlags,
                              nsIOpenWindowInfo* aOpenWindowInfo,
                              nsIWebBrowserChrome** aResult);
  MOZ_CAN_RUN_SCRIPT_BOUNDARY nsresult CreateChromeWindow(
      nsIWebBrowserChrome* aParentChrome, uint32_t aChromeFlags,
      nsIOpenWindowInfo* aOpenWindowInfo, nsIWebBrowserChrome** aResult);

  void MaybeDisablePersistence(const SizeSpec& sizeSpec,
                               nsIDocShellTreeOwner* aTreeOwner);