Index: chrome/browser/extensions/api/commands/command_service.cc |
diff --git a/chrome/browser/extensions/api/commands/command_service.cc b/chrome/browser/extensions/api/commands/command_service.cc |
index ba37a10dd1986b28cf3c96a2b7a446c785dbb17a..5fc50beac68496e065d8084a6519d71a9fb8a191 100644 |
--- a/chrome/browser/extensions/api/commands/command_service.cc |
+++ b/chrome/browser/extensions/api/commands/command_service.cc |
@@ -4,6 +4,7 @@ |
#include "chrome/browser/extensions/api/commands/command_service.h" |
+#include "base/lazy_instance.h" |
#include "base/string_util.h" |
#include "base/utf_string_conversions.h" |
#include "chrome/browser/extensions/extension_keybinding_registry.h" |
@@ -51,6 +52,19 @@ CommandService::CommandService(Profile* profile) |
CommandService::~CommandService() { |
} |
+static base::LazyInstance<ProfileKeyedAPIFactory<CommandService> > |
+g_factory = LAZY_INSTANCE_INITIALIZER; |
+ |
+// static |
+ProfileKeyedAPIFactory<CommandService>* CommandService::GetFactoryInstance() { |
+ return &g_factory.Get(); |
+} |
+ |
+// static |
+CommandService* CommandService::Get(Profile* profile) { |
+ return ProfileKeyedAPIFactory<CommandService>::GetForProfile(profile); |
+} |
+ |
bool CommandService::GetBrowserActionCommand( |
const std::string& extension_id, |
QueryType type, |