| Index: chrome/browser/extensions/api/commands/command_service.h
|
| diff --git a/chrome/browser/extensions/api/commands/command_service.h b/chrome/browser/extensions/api/commands/command_service.h
|
| index ce3ba5a7b78eac3380caff12fd4bfbca555dc2d0..294c3c5e5aa45a6f12ce0eb206504f0bbcdfc895 100644
|
| --- a/chrome/browser/extensions/api/commands/command_service.h
|
| +++ b/chrome/browser/extensions/api/commands/command_service.h
|
| @@ -8,7 +8,7 @@
|
| #include <string>
|
|
|
| #include "base/basictypes.h"
|
| -#include "chrome/browser/profiles/profile_keyed_service.h"
|
| +#include "chrome/browser/extensions/api/profile_keyed_api_factory.h"
|
| #include "chrome/common/extensions/command.h"
|
| #include "chrome/common/extensions/extension.h"
|
| #include "content/public/browser/notification_details.h"
|
| @@ -32,7 +32,7 @@ namespace extensions {
|
| // This service keeps track of preferences related to extension commands
|
| // (assigning initial keybindings on install and removing them on deletion
|
| // and answers questions related to which commands are active.
|
| -class CommandService : public ProfileKeyedService,
|
| +class CommandService : public ProfileKeyedAPI,
|
| public content::NotificationObserver {
|
| public:
|
| // An enum specifying whether to fetch all extension commands or only active
|
| @@ -49,6 +49,12 @@ class CommandService : public ProfileKeyedService,
|
| explicit CommandService(Profile* profile);
|
| virtual ~CommandService();
|
|
|
| + // ProfileKeyedAPI implementation.
|
| + static ProfileKeyedAPIFactory<CommandService>* GetFactoryInstance();
|
| +
|
| + // Convenience method to get the CommandService for a profile.
|
| + static CommandService* Get(Profile* profile);
|
| +
|
| // Gets the command (if any) for the browser action of an extension given
|
| // its |extension_id|. The function consults the master list to see if
|
| // the command is active. Returns false if the extension has no browser
|
| @@ -123,6 +129,14 @@ class CommandService : public ProfileKeyedService,
|
| const content::NotificationDetails& details) OVERRIDE;
|
|
|
| private:
|
| + friend class ProfileKeyedAPIFactory<CommandService>;
|
| +
|
| + // ProfileKeyedAPI implementation.
|
| + static const char* service_name() {
|
| + return "CommandService";
|
| + }
|
| + static const bool kServiceRedirectedInIncognito = true;
|
| +
|
| // An enum specifying the types of icons that can have a command.
|
| enum ExtensionActionType {
|
| BROWSER_ACTION,
|
|
|