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 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 14 matching lines...) Expand all Loading... |
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 enum ExtensionFilter { | 28 enum ExtensionFilter { |
29 ALL_EXTENSIONS, | 29 ALL_EXTENSIONS, |
30 PLATFORM_APPS_ONLY | 30 PLATFORM_APPS_ONLY |
31 }; | 31 }; |
32 | 32 |
33 class Delegate { | 33 class Delegate { |
34 public: | 34 public: |
| 35 virtual ~Delegate() { } |
| 36 |
35 // Gets the ActiveTabPermissionGranter for the active tab, if any. | 37 // Gets the ActiveTabPermissionGranter for the active tab, if any. |
36 // If there is no active tab then returns NULL. | 38 // If there is no active tab then returns NULL. |
37 virtual ActiveTabPermissionGranter* GetActiveTabPermissionGranter() = 0; | 39 virtual ActiveTabPermissionGranter* GetActiveTabPermissionGranter() = 0; |
38 }; | 40 }; |
39 | 41 |
40 // If |extension_filter| is not ALL_EXTENSIONS, only keybindings by | 42 // If |extension_filter| is not ALL_EXTENSIONS, only keybindings by |
41 // by extensions that match the filter will be registered. | 43 // by extensions that match the filter will be registered. |
42 ExtensionKeybindingRegistry(Profile* profile, | 44 ExtensionKeybindingRegistry(Profile* profile, |
43 ExtensionFilter extension_filter, | 45 ExtensionFilter extension_filter, |
44 Delegate* delegate); | 46 Delegate* delegate); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 95 |
94 // Weak pointer to our delegate. Not owned by us. Must outlive this class. | 96 // Weak pointer to our delegate. Not owned by us. Must outlive this class. |
95 Delegate* delegate_; | 97 Delegate* delegate_; |
96 | 98 |
97 DISALLOW_COPY_AND_ASSIGN(ExtensionKeybindingRegistry); | 99 DISALLOW_COPY_AND_ASSIGN(ExtensionKeybindingRegistry); |
98 }; | 100 }; |
99 | 101 |
100 } // namespace extensions | 102 } // namespace extensions |
101 | 103 |
102 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_H_ | 104 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_H_ |
OLD | NEW |