mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-28 00:07:28 +00:00
Bug 36619 - display notification when file picker is blocked r=sicking a=blocking
This commit is contained in:
parent
df751a140e
commit
07afb3378d
@ -505,6 +505,10 @@ const gPopupBlockerObserver = {
|
||||
var pageReport = gBrowser.pageReport;
|
||||
if (pageReport) {
|
||||
for (var i = 0; i < pageReport.length; ++i) {
|
||||
// popupWindowURI will be null if the file picker popup is blocked.
|
||||
// xxxdz this should make the option say "Show file picker" and do it (Bug 590306)
|
||||
if (!pageReport[i].popupWindowURI)
|
||||
continue;
|
||||
var popupURIspec = pageReport[i].popupWindowURI.spec;
|
||||
|
||||
// Sometimes the popup URI that we get back from the pageReport
|
||||
|
@ -110,6 +110,7 @@
|
||||
#include "nsIContentPrefService.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsIPopupWindowManager.h"
|
||||
#include "nsGlobalWindow.h"
|
||||
|
||||
// input type=image
|
||||
#include "nsImageLoadingContent.h"
|
||||
@ -276,8 +277,11 @@ AsyncClickHandler::Run()
|
||||
|
||||
PRUint32 permission;
|
||||
pm->TestPermission(doc->GetDocumentURI(), &permission);
|
||||
if (permission == nsIPopupWindowManager::DENY_POPUP)
|
||||
if (permission == nsIPopupWindowManager::DENY_POPUP) {
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(doc);
|
||||
nsGlobalWindow::FirePopupBlockedEvent(domDoc, win, nsnull, EmptyString(), EmptyString());
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
// Get Loc title
|
||||
|
@ -5007,11 +5007,12 @@ PRBool IsPopupBlocked(nsIDOMDocument* aDoc)
|
||||
return blocked;
|
||||
}
|
||||
|
||||
static
|
||||
void FirePopupBlockedEvent(nsIDOMDocument* aDoc,
|
||||
nsIDOMWindow *aRequestingWindow, nsIURI *aPopupURI,
|
||||
const nsAString &aPopupWindowName,
|
||||
const nsAString &aPopupWindowFeatures)
|
||||
/* static */
|
||||
void
|
||||
nsGlobalWindow::FirePopupBlockedEvent(nsIDOMDocument* aDoc,
|
||||
nsIDOMWindow *aRequestingWindow, nsIURI *aPopupURI,
|
||||
const nsAString &aPopupWindowName,
|
||||
const nsAString &aPopupWindowFeatures)
|
||||
{
|
||||
if (aDoc) {
|
||||
// Fire a "DOMPopupBlocked" event so that the UI can hear about
|
||||
|
@ -481,6 +481,11 @@ public:
|
||||
mCleanedUp);
|
||||
}
|
||||
|
||||
static void FirePopupBlockedEvent(nsIDOMDocument* aDoc,
|
||||
nsIDOMWindow *aRequestingWindow, nsIURI *aPopupURI,
|
||||
const nsAString &aPopupWindowName,
|
||||
const nsAString &aPopupWindowFeatures);
|
||||
|
||||
protected:
|
||||
// Object Management
|
||||
virtual ~nsGlobalWindow();
|
||||
|
Loading…
x
Reference in New Issue
Block a user