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

Side by Side Diff: chrome/browser/extensions/extension_commands_global_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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_commands_global_registry.cc » ('j') | 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_COMMANDS_GLOBAL_REGISTRY_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_COMMANDS_GLOBAL_REGISTRY_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_COMMANDS_GLOBAL_REGISTRY_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_COMMANDS_GLOBAL_REGISTRY_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 23 matching lines...) Expand all
34 public GlobalShortcutListener::Observer { 34 public GlobalShortcutListener::Observer {
35 public: 35 public:
36 // BrowserContextKeyedAPI implementation. 36 // BrowserContextKeyedAPI implementation.
37 static BrowserContextKeyedAPIFactory<ExtensionCommandsGlobalRegistry>* 37 static BrowserContextKeyedAPIFactory<ExtensionCommandsGlobalRegistry>*
38 GetFactoryInstance(); 38 GetFactoryInstance();
39 39
40 // Convenience method to get the ExtensionCommandsGlobalRegistry for a 40 // Convenience method to get the ExtensionCommandsGlobalRegistry for a
41 // profile. 41 // profile.
42 static ExtensionCommandsGlobalRegistry* Get(content::BrowserContext* context); 42 static ExtensionCommandsGlobalRegistry* Get(content::BrowserContext* context);
43 43
44 // Enables/Disables global shortcut handling in Chrome.
45 static void SetShortcutHandlingSuspended(bool suspended);
46
47 explicit ExtensionCommandsGlobalRegistry(content::BrowserContext* context); 44 explicit ExtensionCommandsGlobalRegistry(content::BrowserContext* context);
48 ~ExtensionCommandsGlobalRegistry() override; 45 ~ExtensionCommandsGlobalRegistry() override;
49 46
50 // Returns which non-global command registry is active (belonging to the 47 // Returns which non-global command registry is active (belonging to the
51 // currently active window). 48 // currently active window).
52 ExtensionKeybindingRegistry* registry_for_active_window() { 49 ExtensionKeybindingRegistry* registry_for_active_window() {
53 return registry_for_active_window_; 50 return registry_for_active_window_;
54 } 51 }
55 52
56 void set_registry_for_active_window(ExtensionKeybindingRegistry* registry) { 53 void set_registry_for_active_window(ExtensionKeybindingRegistry* registry) {
(...skipping 10 matching lines...) Expand all
67 // BrowserContextKeyedAPI implementation. 64 // BrowserContextKeyedAPI implementation.
68 static const char* service_name() { 65 static const char* service_name() {
69 return "ExtensionCommandsGlobalRegistry"; 66 return "ExtensionCommandsGlobalRegistry";
70 } 67 }
71 68
72 // Overridden from ExtensionKeybindingRegistry: 69 // Overridden from ExtensionKeybindingRegistry:
73 void AddExtensionKeybindings(const Extension* extension, 70 void AddExtensionKeybindings(const Extension* extension,
74 const std::string& command_name) override; 71 const std::string& command_name) override;
75 void RemoveExtensionKeybindingImpl(const ui::Accelerator& accelerator, 72 void RemoveExtensionKeybindingImpl(const ui::Accelerator& accelerator,
76 const std::string& command_name) override; 73 const std::string& command_name) override;
74 void OnShortcutHandlingSuspended(bool suspended) override;
77 75
78 // Called by the GlobalShortcutListener object when a shortcut this class has 76 // Called by the GlobalShortcutListener object when a shortcut this class has
79 // registered for has been pressed. 77 // registered for has been pressed.
80 void OnKeyPressed(const ui::Accelerator& accelerator) override; 78 void OnKeyPressed(const ui::Accelerator& accelerator) override;
81 79
82 // Weak pointer to our browser context. Not owned by us. 80 // Weak pointer to our browser context. Not owned by us.
83 content::BrowserContext* browser_context_; 81 content::BrowserContext* browser_context_;
84 82
85 // The global commands registry not only keeps track of global commands 83 // The global commands registry not only keeps track of global commands
86 // registered, but also of which non-global command registry is active 84 // registered, but also of which non-global command registry is active
87 // (belonging to the currently active window). Only valid for TOOLKIT_VIEWS 85 // (belonging to the currently active window). Only valid for TOOLKIT_VIEWS
88 // and 86 // and
89 // NULL otherwise. 87 // NULL otherwise.
90 ExtensionKeybindingRegistry* registry_for_active_window_; 88 ExtensionKeybindingRegistry* registry_for_active_window_;
91 89
92 DISALLOW_COPY_AND_ASSIGN(ExtensionCommandsGlobalRegistry); 90 DISALLOW_COPY_AND_ASSIGN(ExtensionCommandsGlobalRegistry);
93 }; 91 };
94 92
95 } // namespace extensions 93 } // namespace extensions
96 94
97 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_COMMANDS_GLOBAL_REGISTRY_H_ 95 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_COMMANDS_GLOBAL_REGISTRY_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_commands_global_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698