| 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_API_COMMANDS_COMMAND_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_COMMANDS_COMMAND_SERVICE_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_COMMANDS_COMMAND_SERVICE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_COMMANDS_COMMAND_SERVICE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 // An enum specifying whether to fetch all extension commands or only active | 39 // An enum specifying whether to fetch all extension commands or only active |
| 40 // ones. | 40 // ones. |
| 41 enum QueryType { | 41 enum QueryType { |
| 42 ALL, | 42 ALL, |
| 43 ACTIVE_ONLY, | 43 ACTIVE_ONLY, |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 // Register prefs for keybinding. | 46 // Register prefs for keybinding. |
| 47 static void RegisterUserPrefs(PrefService* user_prefs); | 47 static void RegisterUserPrefs(PrefService* user_prefs); |
| 48 | 48 |
| 49 // Constructs an CommandService object for the given profile. | 49 // Constructs a CommandService object for the given profile. |
| 50 explicit CommandService(Profile* profile); | 50 explicit CommandService(Profile* profile); |
| 51 virtual ~CommandService(); | 51 virtual ~CommandService(); |
| 52 | 52 |
| 53 // Gets the keybinding (if any) for the browser action of an extension given | 53 // Gets the keybinding (if any) for the browser action of an extension given |
| 54 // its |extension_id|. The function consults the master list to see if | 54 // its |extension_id|. The function consults the master list to see if |
| 55 // the keybinding is active. Returns NULL if the extension has no browser | 55 // the keybinding is active. Returns NULL if the extension has no browser |
| 56 // action. Returns NULL if the keybinding is not active and |type| requested | 56 // action. Returns NULL if the keybinding is not active and |type| requested |
| 57 // is ACTIVE_ONLY. | 57 // is ACTIVE_ONLY. |
| 58 const extensions::Command* GetBrowserActionCommand( | 58 const extensions::Command* GetBrowserActionCommand( |
| 59 const std::string& extension_id, QueryType type); | 59 const std::string& extension_id, QueryType type); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 114 |
| 115 // A weak pointer to the profile we are associated with. Not owned by us. | 115 // A weak pointer to the profile we are associated with. Not owned by us. |
| 116 Profile* profile_; | 116 Profile* profile_; |
| 117 | 117 |
| 118 DISALLOW_COPY_AND_ASSIGN(CommandService); | 118 DISALLOW_COPY_AND_ASSIGN(CommandService); |
| 119 }; | 119 }; |
| 120 | 120 |
| 121 } // namespace extensions | 121 } // namespace extensions |
| 122 | 122 |
| 123 #endif // CHROME_BROWSER_EXTENSIONS_API_COMMANDS_COMMAND_SERVICE_H_ | 123 #endif // CHROME_BROWSER_EXTENSIONS_API_COMMANDS_COMMAND_SERVICE_H_ |
| OLD | NEW |