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

Side by Side Diff: chrome/browser/media_galleries/media_galleries_dialog_controller.cc

Issue 16472007: Rename StorageMonitor Initialize function to EnsureInitialized for better understanding. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update comments Created 7 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/media_galleries/media_galleries_dialog_controller.h" 5 #include "chrome/browser/media_galleries/media_galleries_dialog_controller.h"
6 6
7 #include "base/i18n/time_formatting.h" 7 #include "base/i18n/time_formatting.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 MediaGalleriesDialogController::MediaGalleriesDialogController( 94 MediaGalleriesDialogController::MediaGalleriesDialogController(
95 content::WebContents* web_contents, 95 content::WebContents* web_contents,
96 const Extension& extension, 96 const Extension& extension,
97 const base::Closure& on_finish) 97 const base::Closure& on_finish)
98 : web_contents_(web_contents), 98 : web_contents_(web_contents),
99 extension_(&extension), 99 extension_(&extension),
100 on_finish_(on_finish) { 100 on_finish_(on_finish) {
101 // Passing unretained pointer is safe, since the dialog controller 101 // Passing unretained pointer is safe, since the dialog controller
102 // is self-deleting, and so won't be deleted until it can be shown 102 // is self-deleting, and so won't be deleted until it can be shown
103 // and then closed. 103 // and then closed.
104 StorageMonitor::GetInstance()->Initialize(base::Bind( 104 StorageMonitor::GetInstance()->EnsureInitialized(base::Bind(
105 &MediaGalleriesDialogController::OnStorageMonitorInitialized, 105 &MediaGalleriesDialogController::OnStorageMonitorInitialized,
106 base::Unretained(this))); 106 base::Unretained(this)));
107 } 107 }
108 108
109 void MediaGalleriesDialogController::OnStorageMonitorInitialized() { 109 void MediaGalleriesDialogController::OnStorageMonitorInitialized() {
110 MediaFileSystemRegistry* registry = 110 MediaFileSystemRegistry* registry =
111 g_browser_process->media_file_system_registry(); 111 g_browser_process->media_file_system_registry();
112 preferences_ = registry->GetPreferences( 112 preferences_ = registry->GetPreferences(
113 Profile::FromBrowserContext(web_contents_->GetBrowserContext())); 113 Profile::FromBrowserContext(web_contents_->GetBrowserContext()));
114 InitializePermissions(); 114 InitializePermissions();
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 if (iter->pref_info.device_id == device_id) 515 if (iter->pref_info.device_id == device_id)
516 dialog_->UpdateGallery(iter->pref_info, iter->allowed); 516 dialog_->UpdateGallery(iter->pref_info, iter->allowed);
517 } 517 }
518 } 518 }
519 519
520 // MediaGalleries dialog ------------------------------------------------------- 520 // MediaGalleries dialog -------------------------------------------------------
521 521
522 MediaGalleriesDialog::~MediaGalleriesDialog() {} 522 MediaGalleriesDialog::~MediaGalleriesDialog() {}
523 523
524 } // namespace chrome 524 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698