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

Unified Diff: chrome/browser/extensions/api/preference/preference_api.cc

Issue 166053003: Move ProfileKeyedAPI implementations to take BrowserContext in the constructor (part 2). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: | 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/preference/preference_api.cc
diff --git a/chrome/browser/extensions/api/preference/preference_api.cc b/chrome/browser/extensions/api/preference/preference_api.cc
index 3b3be6913756243c25ede1c0b92d0185836adfe4..93f1c97ad1ebc40b998a60d5009c539d40001cd8 100644
--- a/chrome/browser/extensions/api/preference/preference_api.cc
+++ b/chrome/browser/extensions/api/preference/preference_api.cc
@@ -376,7 +376,8 @@ bool PreferenceAPIBase::DoesExtensionControlPref(
extension_id, pref_key, from_incognito);
}
-PreferenceAPI::PreferenceAPI(Profile* profile) : profile_(profile) {
+PreferenceAPI::PreferenceAPI(content::BrowserContext* context)
+ : profile_(Profile::FromBrowserContext(context)) {
for (size_t i = 0; i < arraysize(kPrefMapping); ++i) {
std::string event_name;
APIPermission::ID permission = APIPermission::kInvalid;
@@ -408,8 +409,8 @@ ProfileKeyedAPIFactory<PreferenceAPI>* PreferenceAPI::GetFactoryInstance() {
}
// static
-PreferenceAPI* PreferenceAPI::Get(Profile* profile) {
- return ProfileKeyedAPIFactory<PreferenceAPI>::GetForProfile(profile);
+PreferenceAPI* PreferenceAPI::Get(content::BrowserContext* context) {
+ return ProfileKeyedAPIFactory<PreferenceAPI>::GetForProfile(context);
}
void PreferenceAPI::OnListenerAdded(const EventListenerInfo& details) {
« no previous file with comments | « chrome/browser/extensions/api/preference/preference_api.h ('k') | chrome/browser/extensions/api/processes/processes_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698