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