| OLD | NEW |
| 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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 class Extension; | 21 class Extension; |
| 22 | 22 |
| 23 // The ExtensionKeybindingRegistry is a class that handles the cross-platform | 23 // The ExtensionKeybindingRegistry is a class that handles the cross-platform |
| 24 // logic for keyboard accelerators. See platform-specific implementations for | 24 // logic for keyboard accelerators. See platform-specific implementations for |
| 25 // implementation details for each platform. | 25 // implementation details for each platform. |
| 26 class ExtensionKeybindingRegistry : public content::NotificationObserver { | 26 class ExtensionKeybindingRegistry : public content::NotificationObserver { |
| 27 public: | 27 public: |
| 28 explicit ExtensionKeybindingRegistry(Profile* profile); | 28 explicit ExtensionKeybindingRegistry(Profile* profile); |
| 29 virtual ~ExtensionKeybindingRegistry(); | 29 virtual ~ExtensionKeybindingRegistry(); |
| 30 | 30 |
| 31 // Enables/Disables general shortcut handing in Chrome. Implemented in |
| 32 // platform-specific ExtensionKeybindingsRegistry* files. |
| 33 static void SetShortcutHandlingSuspended(bool suspended); |
| 34 |
| 31 // Overridden from content::NotificationObserver: | 35 // Overridden from content::NotificationObserver: |
| 32 virtual void Observe(int type, | 36 virtual void Observe(int type, |
| 33 const content::NotificationSource& source, | 37 const content::NotificationSource& source, |
| 34 const content::NotificationDetails& details) OVERRIDE; | 38 const content::NotificationDetails& details) OVERRIDE; |
| 35 | 39 |
| 36 protected: | 40 protected: |
| 37 // Add extension keybinding for the events defined by the |extension|. | 41 // Add extension keybinding for the events defined by the |extension|. |
| 38 virtual void AddExtensionKeybinding( | 42 virtual void AddExtensionKeybinding( |
| 39 const Extension* extension) = 0; | 43 const Extension* extension) = 0; |
| 40 // Remove extension bindings for |extension|. | 44 // Remove extension bindings for |extension|. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 54 | 58 |
| 55 // Weak pointer to the our profile. Not owned by us. | 59 // Weak pointer to the our profile. Not owned by us. |
| 56 Profile* profile_; | 60 Profile* profile_; |
| 57 | 61 |
| 58 DISALLOW_COPY_AND_ASSIGN(ExtensionKeybindingRegistry); | 62 DISALLOW_COPY_AND_ASSIGN(ExtensionKeybindingRegistry); |
| 59 }; | 63 }; |
| 60 | 64 |
| 61 } // namespace extensions | 65 } // namespace extensions |
| 62 | 66 |
| 63 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_H_ | 67 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_H_ |
| OLD | NEW |