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

Unified Diff: chrome/browser/extensions/api/media_galleries/media_galleries_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/media_galleries_api.cc
diff --git a/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc b/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc
index fed85fb911399e934dbd6e0f42ba3433a31c895c..44a531aae1f6fd1a965287cc2a98fd4398c82215 100644
--- a/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc
+++ b/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc
@@ -255,9 +255,9 @@ class SelectDirectoryDialog : public ui::SelectFileDialog::Listener,
} // namespace
-MediaGalleriesEventRouter::MediaGalleriesEventRouter(Profile* profile)
- : profile_(profile),
- weak_ptr_factory_(this) {
+MediaGalleriesEventRouter::MediaGalleriesEventRouter(
+ content::BrowserContext* context)
+ : profile_(Profile::FromBrowserContext(context)), weak_ptr_factory_(this) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
DCHECK(profile_);
media_scan_manager()->AddObserver(profile_, this);
@@ -283,11 +283,13 @@ MediaGalleriesEventRouter::GetFactoryInstance() {
}
// static
-MediaGalleriesEventRouter* MediaGalleriesEventRouter::Get(Profile* profile) {
- DCHECK(media_file_system_registry()->GetPreferences(profile)->
- IsInitialized());
+MediaGalleriesEventRouter* MediaGalleriesEventRouter::Get(
+ content::BrowserContext* context) {
+ DCHECK(media_file_system_registry()
+ ->GetPreferences(Profile::FromBrowserContext(context))
+ ->IsInitialized());
return ProfileKeyedAPIFactory<MediaGalleriesEventRouter>::GetForProfile(
- profile);
+ context);
}
bool MediaGalleriesEventRouter::ExtensionHasScanProgressListener(

Powered by Google App Engine
This is Rietveld 408576698