Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Side by Side Diff: chrome/browser/extensions/extension_keybinding_registry.cc

Issue 552533003: Revert of Fixes HasEventListener check in ExtensionKeybindingRegistry::ExecuteCommands. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@chromevox_commands
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/extension_keybinding_registry.h" 5 #include "chrome/browser/extensions/extension_keybinding_registry.h"
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "chrome/browser/extensions/active_tab_permission_granter.h" 8 #include "chrome/browser/extensions/active_tab_permission_granter.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 return false; 231 return false;
232 } 232 }
233 233
234 bool ExtensionKeybindingRegistry::ExecuteCommands( 234 bool ExtensionKeybindingRegistry::ExecuteCommands(
235 const ui::Accelerator& accelerator, 235 const ui::Accelerator& accelerator,
236 const std::string& extension_id) { 236 const std::string& extension_id) {
237 EventTargets::iterator targets = event_targets_.find(accelerator); 237 EventTargets::iterator targets = event_targets_.find(accelerator);
238 if (targets == event_targets_.end() || targets->second.empty()) 238 if (targets == event_targets_.end() || targets->second.empty())
239 return false; 239 return false;
240 240
241 if (!extension_id.empty() &&
242 !extensions::EventRouter::Get(browser_context_)
243 ->ExtensionHasEventListener(extension_id, kOnCommandEventName))
244 return false;
245
241 bool executed = false; 246 bool executed = false;
242 for (TargetList::const_iterator it = targets->second.begin(); 247 for (TargetList::const_iterator it = targets->second.begin();
243 it != targets->second.end(); it++) { 248 it != targets->second.end(); it++) {
244 if (!extensions::EventRouter::Get(browser_context_)
245 ->ExtensionHasEventListener(it->first, kOnCommandEventName))
246 continue;
247
248 if (extension_id.empty() || it->first == extension_id) { 249 if (extension_id.empty() || it->first == extension_id) {
249 CommandExecuted(it->first, it->second); 250 CommandExecuted(it->first, it->second);
250 executed = true; 251 executed = true;
251 } 252 }
252 } 253 }
253 254
254 return executed; 255 return executed;
255 } 256 }
256 257
257 } // namespace extensions 258 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698