Bug 923971 - Prevent global F10 shortcut from overriding devtools one. r=enndeakin

This commit is contained in:
Hallvord R. M. Steen 2014-10-06 09:56:00 -04:00
parent 3de310db79
commit d4ac7b6bef

View File

@ -77,14 +77,14 @@ nsMenuBarFrame::Init(nsIContent* aContent,
// Also hook up the listener to the window listening for focus events. This is so we can keep proper
// state as the user alt-tabs through processes.
mTarget->AddEventListener(NS_LITERAL_STRING("keypress"), mMenuBarListener, false);
mTarget->AddEventListener(NS_LITERAL_STRING("keydown"), mMenuBarListener, false);
mTarget->AddEventListener(NS_LITERAL_STRING("keyup"), mMenuBarListener, false);
mTarget->AddSystemEventListener(NS_LITERAL_STRING("keypress"), mMenuBarListener, false);
mTarget->AddSystemEventListener(NS_LITERAL_STRING("keydown"), mMenuBarListener, false);
mTarget->AddSystemEventListener(NS_LITERAL_STRING("keyup"), mMenuBarListener, false);
// mousedown event should be handled in all phase
mTarget->AddEventListener(NS_LITERAL_STRING("mousedown"), mMenuBarListener, true);
mTarget->AddEventListener(NS_LITERAL_STRING("mousedown"), mMenuBarListener, false);
mTarget->AddEventListener(NS_LITERAL_STRING("blur"), mMenuBarListener, true);
mTarget->AddSystemEventListener(NS_LITERAL_STRING("mousedown"), mMenuBarListener, true);
mTarget->AddSystemEventListener(NS_LITERAL_STRING("mousedown"), mMenuBarListener, false);
mTarget->AddSystemEventListener(NS_LITERAL_STRING("blur"), mMenuBarListener, true);
}
NS_IMETHODIMP
@ -411,13 +411,13 @@ nsMenuBarFrame::DestroyFrom(nsIFrame* aDestructRoot)
if (pm)
pm->SetActiveMenuBar(this, false);
mTarget->RemoveEventListener(NS_LITERAL_STRING("keypress"), mMenuBarListener, false);
mTarget->RemoveEventListener(NS_LITERAL_STRING("keydown"), mMenuBarListener, false);
mTarget->RemoveEventListener(NS_LITERAL_STRING("keyup"), mMenuBarListener, false);
mTarget->RemoveSystemEventListener(NS_LITERAL_STRING("keypress"), mMenuBarListener, false);
mTarget->RemoveSystemEventListener(NS_LITERAL_STRING("keydown"), mMenuBarListener, false);
mTarget->RemoveSystemEventListener(NS_LITERAL_STRING("keyup"), mMenuBarListener, false);
mTarget->RemoveEventListener(NS_LITERAL_STRING("mousedown"), mMenuBarListener, true);
mTarget->RemoveEventListener(NS_LITERAL_STRING("mousedown"), mMenuBarListener, false);
mTarget->RemoveEventListener(NS_LITERAL_STRING("blur"), mMenuBarListener, true);
mTarget->RemoveSystemEventListener(NS_LITERAL_STRING("mousedown"), mMenuBarListener, true);
mTarget->RemoveSystemEventListener(NS_LITERAL_STRING("mousedown"), mMenuBarListener, false);
mTarget->RemoveSystemEventListener(NS_LITERAL_STRING("blur"), mMenuBarListener, true);
NS_IF_RELEASE(mMenuBarListener);