Bug 815561 - Limit Web Activities to the foreground application [r=sicking]

This commit is contained in:
Fabrice Desré 2012-11-27 08:40:18 -08:00
parent 9247e18290
commit 6f0283dfd3

View File

@ -6,7 +6,7 @@
#include "nsDOMClassInfo.h" #include "nsDOMClassInfo.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "nsIDOMActivityOptions.h" #include "nsIDOMActivityOptions.h"
#include "nsEventStateManager.h" #include "nsIDocShell.h"
#include "nsIConsoleService.h" #include "nsIConsoleService.h"
using namespace mozilla::dom; using namespace mozilla::dom;
@ -53,9 +53,12 @@ Activity::Initialize(nsISupports* aOwner,
Init(window); Init(window);
nsCOMPtr<nsIDocument> document = do_QueryInterface(window->GetExtantDocument()); nsCOMPtr<nsIDocument> document = do_QueryInterface(window->GetExtantDoc());
if (!nsEventStateManager::IsHandlingUserInput() && bool isActive;
window->GetDocShell()->GetIsActive(&isActive);
if (!isActive &&
!nsContentUtils::IsChromeDoc(document)) { !nsContentUtils::IsChromeDoc(document)) {
nsCOMPtr<nsIDOMRequestService> rs = nsCOMPtr<nsIDOMRequestService> rs =
do_GetService("@mozilla.org/dom/dom-request-service;1"); do_GetService("@mozilla.org/dom/dom-request-service;1");