Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1404)

Unified Diff: chrome/browser/extensions/api/commands/command_service.cc

Issue 171813010: Move ProfileKeyedAPI implementations to take BrowserContext in the constructor (part 1). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: browser_context_ Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 70b29f8c0e17e76f9bf9107687ab48c488b245cd..1968809350429a1cc38eb0ecf1dc1833ff8e8970 100644
--- a/chrome/browser/extensions/api/commands/command_service.cc
+++ b/chrome/browser/extensions/api/commands/command_service.cc
@@ -149,15 +149,17 @@ void CommandService::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
}
-CommandService::CommandService(Profile* profile)
- : profile_(profile) {
+CommandService::CommandService(content::BrowserContext* context)
+ : profile_(Profile::FromBrowserContext(context)) {
ExtensionFunctionRegistry::GetInstance()->
RegisterFunction<GetAllCommandsFunction>();
- registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_INSTALLED,
- content::Source<Profile>(profile));
- registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED,
- content::Source<Profile>(profile));
+ registrar_.Add(this,
+ chrome::NOTIFICATION_EXTENSION_INSTALLED,
+ content::Source<Profile>(profile_));
+ registrar_.Add(this,
+ chrome::NOTIFICATION_EXTENSION_UNINSTALLED,
+ content::Source<Profile>(profile_));
}
CommandService::~CommandService() {
@@ -172,8 +174,8 @@ ProfileKeyedAPIFactory<CommandService>* CommandService::GetFactoryInstance() {
}
// static
-CommandService* CommandService::Get(Profile* profile) {
- return ProfileKeyedAPIFactory<CommandService>::GetForProfile(profile);
+CommandService* CommandService::Get(content::BrowserContext* context) {
+ return ProfileKeyedAPIFactory<CommandService>::GetForProfile(context);
}
// static
« no previous file with comments | « chrome/browser/extensions/api/commands/command_service.h ('k') | chrome/browser/extensions/api/cookies/cookies_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698