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

Unified Diff: chrome/browser/media_galleries/media_file_system_registry.h

Issue 14556015: [Media Galleries] Lazily initialize the storage monitor. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Privatize 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_file_system_registry.h
diff --git a/chrome/browser/media_galleries/media_file_system_registry.h b/chrome/browser/media_galleries/media_file_system_registry.h
index 6843c3a0f87826bfbae243f8c4512987ddb54626..eba34b5720dcc918d1e51e832d9118bdfa2bc402 100644
--- a/chrome/browser/media_galleries/media_file_system_registry.h
+++ b/chrome/browser/media_galleries/media_file_system_registry.h
@@ -85,9 +85,16 @@ class MediaFileSystemRegistry : public RemovableStorageObserver {
// |profile|. This method should be used instead of calling
// MediaGalleriesPreferences directly because this method also ensures that
// currently attached removable devices are added to the preferences.
- // Called on the UI thread.
+ // Called on the UI thread. Do not call from outside this class.
vandebo (ex-Chrome) 2013/05/10 21:20:39 If it should only be called from within this class
Greg Billock 2013/05/13 21:20:38 It should be. I was going to wait, but I'll just t
MediaGalleriesPreferences* GetPreferences(Profile* profile);
+ // Call the given callback with preferences. This is asynchronous so that
Lei Zhang 2013/05/11 02:12:23 If GetPreferences() is going to be private, you ma
Greg Billock 2013/05/13 21:20:38 Done.
+ // StorageMonitor may be initialized lazily in order to set up the returned
+ // preferences.
+ void GetPreferencesAsync(
+ Profile* profile,
+ base::Callback<void(MediaGalleriesPreferences*)> callback);
+
// RemovableStorageObserver implementation.
virtual void OnRemovableStorageDetached(const StorageInfo& info) OVERRIDE;
@@ -100,6 +107,19 @@ class MediaFileSystemRegistry : public RemovableStorageObserver {
friend class TestMediaFileSystemContext;
class MediaFileSystemContextImpl;
+ // Bottom half of |GetMediaFileSystemsForExtensions|, called after the
+ // StorageMonitor is initialized.
+ void GetMediaFileSystemsPostStorageMonitorInit(
+ const content::RenderViewHost* rvh,
+ const extensions::Extension* extension,
+ const MediaFileSystemsCallback& callback,
+ MediaGalleriesPreferences* preferences);
+
+ // Notify the registry when the storage monitor has been initialized.
+ void OnStorageMonitorInitialized(
+ Profile* profile,
+ base::Callback<void(MediaGalleriesPreferences*)> callback);
+
// Map an extension to the ExtensionGalleriesHost.
typedef std::map<std::string /*extension_id*/,
scoped_refptr<ExtensionGalleriesHost> > ExtensionHostMap;

Powered by Google App Engine
This is Rietveld 408576698