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

Unified Diff: chrome/browser/extensions/extension_keybinding_registry.h

Issue 838253004: MacViews: Fix duplicate definition of ExtensionKeyBindingRegistry::SetShortcutHandlingSuspended (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@DragBookmarks2
Patch Set: Fix Mac Created 5 years, 11 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/extensions/extension_keybinding_registry.h
diff --git a/chrome/browser/extensions/extension_keybinding_registry.h b/chrome/browser/extensions/extension_keybinding_registry.h
index ec9baa1065b9aff7acc2f324d1b68f2b885b08ba..5714bfb065bb6de85abc37f82866b582717ff86d 100644
--- a/chrome/browser/extensions/extension_keybinding_registry.h
+++ b/chrome/browser/extensions/extension_keybinding_registry.h
@@ -57,9 +57,11 @@ class ExtensionKeybindingRegistry : public content::NotificationObserver,
~ExtensionKeybindingRegistry() override;
- // Enables/Disables general shortcut handling in Chrome. Implemented in
- // platform-specific ExtensionKeybindingsRegistry* files.
- static void SetShortcutHandlingSuspended(bool suspended);
+ // Enables/Disables general shortcut handling in Chrome.
+ void SetShortcutHandlingSuspended(bool suspended);
+ bool shortcut_handling_suspended() const {
+ return shortcut_handling_suspended_;
+ }
// Execute the command bound to |accelerator| and provided by the extension
// with |extension_id|, if it exists.
@@ -87,6 +89,9 @@ class ExtensionKeybindingRegistry : public content::NotificationObserver,
const ui::Accelerator& accelerator,
const std::string& command_name) = 0;
+ // Called when shortcut handling is suspended or resumed.
+ virtual void OnShortcutHandlingSuspended(bool suspended) {}
+
// Make sure all extensions registered have keybindings added.
void Init();
@@ -173,6 +178,13 @@ class ExtensionKeybindingRegistry : public content::NotificationObserver,
ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver>
extension_registry_observer_;
+ // Keeps track of whether shortcut handling is currently suspended. Shortcuts
+ // are suspended briefly while capturing which shortcut to assign to an
+ // extension command in the Config UI. If handling isn't suspended while
+ // capturing then trying to assign Ctrl+F to a command would instead result
+ // in the Find box opening.
+ bool shortcut_handling_suspended_;
+
DISALLOW_COPY_AND_ASSIGN(ExtensionKeybindingRegistry);
};

Powered by Google App Engine
This is Rietveld 408576698