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