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

Unified Diff: chrome/browser/ui/cocoa/browser_window_controller.mm

Issue 553243002: Track the active ExtensionKeybindingRegistry and make it available to EventRewriter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Fix bool vs BOOL. 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/browser_window_controller.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm
index 45ec95fdb3a36e2556468c858dbac700ba39201a..2b6ee211747a89af0ca4451c198d147697f70f1d 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -20,6 +20,7 @@
#include "chrome/browser/bookmarks/chrome_bookmark_client_factory.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/devtools/devtools_window.h"
+#include "chrome/browser/extensions/extension_commands_global_registry.h"
#include "chrome/browser/fullscreen.h"
#include "chrome/browser/profiles/avatar_menu.h"
#include "chrome/browser/profiles/profile.h"
@@ -92,6 +93,7 @@
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
+#include "ui/base/accelerators/accelerator.h"
#import "ui/base/cocoa/cocoa_base_utils.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/l10n/l10n_util_mac.h"
@@ -2030,6 +2032,13 @@ willAnimateFromState:(BookmarkBar::State)oldState
command.accelerator());
}
+- (BOOL)isExtensionCommandRegisteredForAccelerator:
+ (const ui::Accelerator&)accelerator {
+ return extensions::ExtensionCommandsGlobalRegistry::Get(browser_->profile())->
+ IsAcceleratorRegistered(accelerator) ||
+ extension_keybinding_registry_->IsAcceleratorRegistered(accelerator);
+}
+
@end // @implementation BrowserWindowController
@implementation BrowserWindowController(Fullscreen)

Powered by Google App Engine
This is Rietveld 408576698