| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 private: | 172 private: |
| 173 friend class BrowserContextKeyedAPIFactory<CommandService>; | 173 friend class BrowserContextKeyedAPIFactory<CommandService>; |
| 174 | 174 |
| 175 // BrowserContextKeyedAPI implementation. | 175 // BrowserContextKeyedAPI implementation. |
| 176 static const char* service_name() { | 176 static const char* service_name() { |
| 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 void OnExtensionWillBeInstalled(content::BrowserContext* browser_context, | 182 virtual void OnExtensionLoaded(content::BrowserContext* browser_context, |
| 183 const Extension* extension, | 183 const Extension* extension) override; |
| 184 bool is_update, | 184 |
| 185 bool from_ephemeral, | 185 virtual void OnExtensionUnloaded( |
| 186 const std::string& old_name) override; | 186 content::BrowserContext* browser_context, |
| 187 void OnExtensionUninstalled(content::BrowserContext* browser_context, | 187 const Extension* extension, |
| 188 const Extension* extension, | 188 UnloadedExtensionInfo::Reason reason) override; |
| 189 extensions::UninstallReason reason) override; | |
| 190 | 189 |
| 191 // Updates keybindings for a given |extension|'s page action, browser action | 190 // Updates keybindings for a given |extension|'s page action, browser action |
| 192 // and named commands. Assigns new keybindings and removes relinquished | 191 // and named commands. Assigns new keybindings and removes relinquished |
| 193 // keybindings if not changed by the user. In the case of adding keybindings, | 192 // keybindings if not changed by the user. In the case of adding keybindings, |
| 194 // if the suggested keybinding is free, it will be taken by this extension. If | 193 // if the suggested keybinding is free, it will be taken by this extension. If |
| 195 // not, the keybinding request is ignored. | 194 // not, the keybinding request is ignored. |
| 196 void UpdateKeybindings(const Extension* extension); | 195 void UpdateKeybindings(const Extension* extension); |
| 197 | 196 |
| 198 // On update, removes keybindings that the extension previously suggested but | 197 // On update, removes keybindings that the extension previously suggested but |
| 199 // now no longer does, as long as the user has not modified them. | 198 // 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... |
| 246 DISALLOW_COPY_AND_ASSIGN(CommandService); | 245 DISALLOW_COPY_AND_ASSIGN(CommandService); |
| 247 }; | 246 }; |
| 248 | 247 |
| 249 template <> | 248 template <> |
| 250 void | 249 void |
| 251 BrowserContextKeyedAPIFactory<CommandService>::DeclareFactoryDependencies(); | 250 BrowserContextKeyedAPIFactory<CommandService>::DeclareFactoryDependencies(); |
| 252 | 251 |
| 253 } // namespace extensions | 252 } // namespace extensions |
| 254 | 253 |
| 255 #endif // CHROME_BROWSER_EXTENSIONS_API_COMMANDS_COMMAND_SERVICE_H_ | 254 #endif // CHROME_BROWSER_EXTENSIONS_API_COMMANDS_COMMAND_SERVICE_H_ |
| OLD | NEW |