diff options
Diffstat (limited to 'widget/windows/nsFilePicker.cpp')
-rw-r--r-- | widget/windows/nsFilePicker.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/widget/windows/nsFilePicker.cpp b/widget/windows/nsFilePicker.cpp index 310c54bb40..fb4c6e80b5 100644 --- a/widget/windows/nsFilePicker.cpp +++ b/widget/windows/nsFilePicker.cpp @@ -19,6 +19,7 @@ #include "mozilla/BackgroundHangMonitor.h" #include "mozilla/Components.h" #include "mozilla/dom/BrowsingContext.h" +#include "mozilla/dom/CanonicalBrowsingContext.h" #include "mozilla/dom/Directory.h" #include "mozilla/Logging.h" #include "mozilla/ipc/UtilityProcessManager.h" @@ -94,19 +95,14 @@ nsFilePicker::nsFilePicker() : mSelectedType(1) {} NS_IMPL_ISUPPORTS(nsFilePicker, nsIFilePicker) NS_IMETHODIMP nsFilePicker::Init( - mozIDOMWindowProxy* aParent, const nsAString& aTitle, - nsIFilePicker::Mode aMode, - mozilla::dom::BrowsingContext* aBrowsingContext) { + mozilla::dom::BrowsingContext* aBrowsingContext, const nsAString& aTitle, + nsIFilePicker::Mode aMode) { // Don't attempt to open a real file-picker in headless mode. if (gfxPlatform::IsHeadless()) { return nsresult::NS_ERROR_NOT_AVAILABLE; } - nsCOMPtr<nsPIDOMWindowOuter> window = do_QueryInterface(aParent); - nsIDocShell* docShell = window ? window->GetDocShell() : nullptr; - mLoadContext = do_QueryInterface(docShell); - - return nsBaseFilePicker::Init(aParent, aTitle, aMode, aBrowsingContext); + return nsBaseFilePicker::Init(aBrowsingContext, aTitle, aMode); } namespace mozilla::detail { @@ -1053,7 +1049,7 @@ void nsFilePicker::RememberLastUsedDirectory() { } bool nsFilePicker::IsPrivacyModeEnabled() { - return mLoadContext && mLoadContext->UsePrivateBrowsing(); + return mBrowsingContext && mBrowsingContext->UsePrivateBrowsing(); } bool nsFilePicker::IsDefaultPathLink() { |