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

Unified Diff: chrome/browser/extensions/api/media_galleries_private/media_galleries_private_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/media_galleries_private/media_galleries_private_api.cc
diff --git a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.cc b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.cc
index 5a6046892c6d5a7cc547f39efc7b1d0b1b52c8ea..b8fd72ae9d8da2df6b498b1d79d0cacae37164ae 100644
--- a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.cc
+++ b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.cc
@@ -81,15 +81,16 @@ bool GetGalleryFilePathAndId(const std::string& gallery_id,
// MediaGalleriesPrivateAPI //
///////////////////////////////////////////////////////////////////////////////
-MediaGalleriesPrivateAPI::MediaGalleriesPrivateAPI(Profile* profile)
- : profile_(profile),
- weak_ptr_factory_(this) {
+MediaGalleriesPrivateAPI::MediaGalleriesPrivateAPI(
+ content::BrowserContext* context)
+ : profile_(Profile::FromBrowserContext(context)), weak_ptr_factory_(this) {
DCHECK(profile_);
- ExtensionSystem::Get(profile_)->event_router()->RegisterObserver(
+ EventRouter* event_router = ExtensionSystem::Get(profile_)->event_router();
+ event_router->RegisterObserver(
this, media_galleries_private::OnDeviceAttached::kEventName);
- ExtensionSystem::Get(profile_)->event_router()->RegisterObserver(
+ event_router->RegisterObserver(
this, media_galleries_private::OnDeviceDetached::kEventName);
- ExtensionSystem::Get(profile_)->event_router()->RegisterObserver(
+ event_router->RegisterObserver(
this, media_galleries_private::OnGalleryChanged::kEventName);
}
@@ -114,9 +115,10 @@ ProfileKeyedAPIFactory<MediaGalleriesPrivateAPI>*
}
// static
-MediaGalleriesPrivateAPI* MediaGalleriesPrivateAPI::Get(Profile* profile) {
- return
- ProfileKeyedAPIFactory<MediaGalleriesPrivateAPI>::GetForProfile(profile);
+MediaGalleriesPrivateAPI* MediaGalleriesPrivateAPI::Get(
+ content::BrowserContext* context) {
+ return ProfileKeyedAPIFactory<MediaGalleriesPrivateAPI>::GetForProfile(
+ context);
}
void MediaGalleriesPrivateAPI::OnListenerAdded(

Powered by Google App Engine
This is Rietveld 408576698