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

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: Windows compile tweaks 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 ec58a53e216d60efb2f6a8d06baa6ef5d01a3e41..d66d87e35a8f6c31a178f9157d5fe3b5a7cea3ac 100644
--- a/chrome/browser/media_galleries/media_galleries_dialog_controller.cc
+++ b/chrome/browser/media_galleries/media_galleries_dialog_controller.cc
@@ -64,8 +64,15 @@ MediaGalleriesDialogController::MediaGalleriesDialogController(
on_finish_(on_finish) {
MediaFileSystemRegistry* registry =
g_browser_process->media_file_system_registry();
- preferences_ = registry->GetPreferences(
- Profile::FromBrowserContext(web_contents->GetBrowserContext()));
+ registry->GetPreferencesAsync(
+ Profile::FromBrowserContext(web_contents->GetBrowserContext()),
+ base::Bind(&MediaGalleriesDialogController::Init,
+ base::Unretained(this)));
+}
+
+void MediaGalleriesDialogController::Init(
+ MediaGalleriesPreferences* preferences) {
+ preferences_ = preferences;
InitializePermissions();
dialog_.reset(MediaGalleriesDialog::Create(this));

Powered by Google App Engine
This is Rietveld 408576698