| 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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 return "CommandService"; | 177 return "CommandService"; |
| 178 } | 178 } |
| 179 static const bool kServiceRedirectedInIncognito = true; | 179 static const bool kServiceRedirectedInIncognito = true; |
| 180 | 180 |
| 181 // ExtensionRegistryObserver. | 181 // ExtensionRegistryObserver. |
| 182 virtual void OnExtensionWillBeInstalled( | 182 virtual void OnExtensionWillBeInstalled( |
| 183 content::BrowserContext* browser_context, | 183 content::BrowserContext* browser_context, |
| 184 const Extension* extension, | 184 const Extension* extension, |
| 185 bool is_update, | 185 bool is_update, |
| 186 bool from_ephemeral, | 186 bool from_ephemeral, |
| 187 const std::string& old_name) OVERRIDE; | 187 const std::string& old_name) override; |
| 188 virtual void OnExtensionUninstalled( | 188 virtual void OnExtensionUninstalled( |
| 189 content::BrowserContext* browser_context, | 189 content::BrowserContext* browser_context, |
| 190 const Extension* extension, | 190 const Extension* extension, |
| 191 extensions::UninstallReason reason) OVERRIDE; | 191 extensions::UninstallReason reason) override; |
| 192 | 192 |
| 193 // Updates keybindings for a given |extension|'s page action, browser action | 193 // Updates keybindings for a given |extension|'s page action, browser action |
| 194 // and named commands. Assigns new keybindings and removes relinquished | 194 // and named commands. Assigns new keybindings and removes relinquished |
| 195 // keybindings if not changed by the user. In the case of adding keybindings, | 195 // keybindings if not changed by the user. In the case of adding keybindings, |
| 196 // if the suggested keybinding is free, it will be taken by this extension. If | 196 // if the suggested keybinding is free, it will be taken by this extension. If |
| 197 // not, the keybinding request is ignored. | 197 // not, the keybinding request is ignored. |
| 198 void UpdateKeybindings(const Extension* extension); | 198 void UpdateKeybindings(const Extension* extension); |
| 199 | 199 |
| 200 // On update, removes keybindings that the extension previously suggested but | 200 // On update, removes keybindings that the extension previously suggested but |
| 201 // now no longer does, as long as the user has not modified them. | 201 // now no longer does, as long as the user has not modified them. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 DISALLOW_COPY_AND_ASSIGN(CommandService); | 248 DISALLOW_COPY_AND_ASSIGN(CommandService); |
| 249 }; | 249 }; |
| 250 | 250 |
| 251 template <> | 251 template <> |
| 252 void | 252 void |
| 253 BrowserContextKeyedAPIFactory<CommandService>::DeclareFactoryDependencies(); | 253 BrowserContextKeyedAPIFactory<CommandService>::DeclareFactoryDependencies(); |
| 254 | 254 |
| 255 } // namespace extensions | 255 } // namespace extensions |
| 256 | 256 |
| 257 #endif // CHROME_BROWSER_EXTENSIONS_API_COMMANDS_COMMAND_SERVICE_H_ | 257 #endif // CHROME_BROWSER_EXTENSIONS_API_COMMANDS_COMMAND_SERVICE_H_ |
| OLD | NEW |