Bug 944130 - test_speakermanager.html: ASSERTION: background state is only maintained on outer windows. r=amarchesini

This commit is contained in:
Randy Lin 2013-12-01 13:23:00 +08:00
parent 9c774494a5
commit c6ad9738fe

View File

@ -110,10 +110,12 @@ SpeakerManager::DispatchSimpleEvent(const nsAString& aStr)
void
SpeakerManager::Init(nsPIDOMWindow* aWindow)
{
BindToOwner(aWindow->IsOuterWindow() ?
aWindow->GetCurrentInnerWindow() : aWindow);
BindToOwner(aWindow);
nsCOMPtr<nsIDocShell> docshell = do_GetInterface(GetOwner());
NS_ENSURE_TRUE_VOID(docshell);
docshell->GetIsActive(&mVisible);
mVisible = !GetOwner()->IsBackground();
nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(GetOwner());
NS_ENSURE_TRUE_VOID(target);