Commit bcc71a37 authored by dtseng's avatar dtseng Committed by Commit bot

Reland 189a2ed4d209231d517b0e64a722722dead3f17a Fixes HasEventListener check...

Reland 189a2ed4d209231d517b0e64a722722dead3f17a Fixes HasEventListener check in ExtensionKeybindingR

TBR=dtseng@chromium.org

Review URL: https://codereview.chromium.org/554073002

Cr-Commit-Position: refs/heads/master@{#294014}
parent 59c4ad10
...@@ -701,7 +701,15 @@ IN_PROC_BROWSER_TEST_F(CommandsApiTest, ...@@ -701,7 +701,15 @@ IN_PROC_BROWSER_TEST_F(CommandsApiTest,
EXPECT_TRUE(accelerator.IsAltDown()); EXPECT_TRUE(accelerator.IsAltDown());
} }
IN_PROC_BROWSER_TEST_F(CommandsApiTest, ContinuePropagation) { //
#if defined(OS_CHROMEOS) && !defined(NDEBUG)
// TODO(dtseng): Test times out on Chrome OS debug. See http://crbug.com/412456.
#define MAYBE_ContinuePropagation DISABLED_ContinuePropagation
#else
#define MAYBE_ContinuePropagation ContinuePropagation
#endif
IN_PROC_BROWSER_TEST_F(CommandsApiTest, MAYBE_ContinuePropagation) {
// Setup the environment. // Setup the environment.
ASSERT_TRUE(test_server()->Start()); ASSERT_TRUE(test_server()->Start());
ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
......
...@@ -238,14 +238,13 @@ bool ExtensionKeybindingRegistry::ExecuteCommands( ...@@ -238,14 +238,13 @@ bool ExtensionKeybindingRegistry::ExecuteCommands(
if (targets == event_targets_.end() || targets->second.empty()) if (targets == event_targets_.end() || targets->second.empty())
return false; return false;
if (!extension_id.empty() &&
!extensions::EventRouter::Get(browser_context_)
->ExtensionHasEventListener(extension_id, kOnCommandEventName))
return false;
bool executed = false; bool executed = false;
for (TargetList::const_iterator it = targets->second.begin(); for (TargetList::const_iterator it = targets->second.begin();
it != targets->second.end(); it++) { it != targets->second.end(); it++) {
if (!extensions::EventRouter::Get(browser_context_)
->ExtensionHasEventListener(it->first, kOnCommandEventName))
continue;
if (extension_id.empty() || it->first == extension_id) { if (extension_id.empty() || it->first == extension_id) {
CommandExecuted(it->first, it->second); CommandExecuted(it->first, it->second);
executed = true; executed = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment