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

Unified Diff: chrome/browser/media_galleries/media_galleries_dialog_controller.cc

Issue 14556015: [Media Galleries] Lazily initialize the storage monitor. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase on prefs Created 7 years, 7 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/media_galleries/media_galleries_dialog_controller.cc
diff --git a/chrome/browser/media_galleries/media_galleries_dialog_controller.cc b/chrome/browser/media_galleries/media_galleries_dialog_controller.cc
index 56243441a859c7a2fbf6d1202add9d090952a82f..274e12fcc33458017fe0e29085364865eb9db149 100644
--- a/chrome/browser/media_galleries/media_galleries_dialog_controller.cc
+++ b/chrome/browser/media_galleries/media_galleries_dialog_controller.cc
@@ -99,10 +99,16 @@ MediaGalleriesDialogController::MediaGalleriesDialogController(
: web_contents_(web_contents),
extension_(&extension),
on_finish_(on_finish) {
+ StorageMonitor::GetInstance()->Initialize(base::Bind(
vandebo (ex-Chrome) 2013/05/23 15:04:17 nit: add a comment about why unretained is safe.
Greg Billock 2013/05/30 22:17:47 Done.
+ &MediaGalleriesDialogController::OnStorageMonitorInitialized,
+ base::Unretained(this)));
+}
+
+void MediaGalleriesDialogController::OnStorageMonitorInitialized() {
MediaFileSystemRegistry* registry =
g_browser_process->media_file_system_registry();
preferences_ = registry->GetPreferences(
- Profile::FromBrowserContext(web_contents->GetBrowserContext()));
+ Profile::FromBrowserContext(web_contents_->GetBrowserContext()));
InitializePermissions();
dialog_.reset(MediaGalleriesDialog::Create(this));

Powered by Google App Engine
This is Rietveld 408576698