OLD | NEW |
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 // MediaFileSystemRegistry registers pictures directories and media devices as | 5 // MediaFileSystemRegistry registers pictures directories and media devices as |
6 // File API filesystems and keeps track of the path to filesystem ID mappings. | 6 // File API filesystems and keeps track of the path to filesystem ID mappings. |
7 | 7 |
8 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_FILE_SYSTEM_REGISTRY_H_ | 8 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_FILE_SYSTEM_REGISTRY_H_ |
9 #define CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_FILE_SYSTEM_REGISTRY_H_ | 9 #define CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_FILE_SYSTEM_REGISTRY_H_ |
10 | 10 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 // Returns the media galleries preferences for the specified |profile|. | 93 // Returns the media galleries preferences for the specified |profile|. |
94 // Caller is responsible for ensuring that the preferences are initialized | 94 // Caller is responsible for ensuring that the preferences are initialized |
95 // before use. | 95 // before use. |
96 MediaGalleriesPreferences* GetPreferences(Profile* profile); | 96 MediaGalleriesPreferences* GetPreferences(Profile* profile); |
97 | 97 |
98 MediaScanManager* media_scan_manager(); | 98 MediaScanManager* media_scan_manager(); |
99 GalleryWatchManager* gallery_watch_manager(); | 99 GalleryWatchManager* gallery_watch_manager(); |
100 | 100 |
101 // RemovableStorageObserver implementation. | 101 // RemovableStorageObserver implementation. |
102 virtual void OnRemovableStorageDetached( | 102 virtual void OnRemovableStorageDetached( |
103 const storage_monitor::StorageInfo& info) OVERRIDE; | 103 const storage_monitor::StorageInfo& info) override; |
104 | 104 |
105 private: | 105 private: |
106 class MediaFileSystemContextImpl; | 106 class MediaFileSystemContextImpl; |
107 | 107 |
108 friend class MediaFileSystemContextImpl; | 108 friend class MediaFileSystemContextImpl; |
109 friend class MediaFileSystemRegistryTest; | 109 friend class MediaFileSystemRegistryTest; |
110 friend class TestMediaFileSystemContext; | 110 friend class TestMediaFileSystemContext; |
111 | 111 |
112 // Map an extension to the ExtensionGalleriesHost. | 112 // Map an extension to the ExtensionGalleriesHost. |
113 typedef std::map<std::string /*extension_id*/, | 113 typedef std::map<std::string /*extension_id*/, |
114 scoped_refptr<ExtensionGalleriesHost> > ExtensionHostMap; | 114 scoped_refptr<ExtensionGalleriesHost> > ExtensionHostMap; |
115 // Map a profile and extension to the ExtensionGalleriesHost. | 115 // Map a profile and extension to the ExtensionGalleriesHost. |
116 typedef std::map<Profile*, ExtensionHostMap> ExtensionGalleriesHostMap; | 116 typedef std::map<Profile*, ExtensionHostMap> ExtensionGalleriesHostMap; |
117 | 117 |
118 virtual void OnPermissionRemoved(MediaGalleriesPreferences* pref, | 118 virtual void OnPermissionRemoved(MediaGalleriesPreferences* pref, |
119 const std::string& extension_id, | 119 const std::string& extension_id, |
120 MediaGalleryPrefId pref_id) OVERRIDE; | 120 MediaGalleryPrefId pref_id) override; |
121 virtual void OnGalleryRemoved(MediaGalleriesPreferences* pref, | 121 virtual void OnGalleryRemoved(MediaGalleriesPreferences* pref, |
122 MediaGalleryPrefId pref_id) OVERRIDE; | 122 MediaGalleryPrefId pref_id) override; |
123 | 123 |
124 // Look up or create the extension gallery host. | 124 // Look up or create the extension gallery host. |
125 ExtensionGalleriesHost* GetExtensionGalleryHost( | 125 ExtensionGalleriesHost* GetExtensionGalleryHost( |
126 Profile* profile, | 126 Profile* profile, |
127 MediaGalleriesPreferences* preferences, | 127 MediaGalleriesPreferences* preferences, |
128 const std::string& extension_id); | 128 const std::string& extension_id); |
129 | 129 |
130 void OnExtensionGalleriesHostEmpty(Profile* profile, | 130 void OnExtensionGalleriesHostEmpty(Profile* profile, |
131 const std::string& extension_id); | 131 const std::string& extension_id); |
132 | 132 |
133 // This map owns all the ExtensionGalleriesHost objects created. | 133 // This map owns all the ExtensionGalleriesHost objects created. |
134 ExtensionGalleriesHostMap extension_hosts_map_; | 134 ExtensionGalleriesHostMap extension_hosts_map_; |
135 | 135 |
136 scoped_ptr<MediaFileSystemContext> file_system_context_; | 136 scoped_ptr<MediaFileSystemContext> file_system_context_; |
137 | 137 |
138 scoped_ptr<MediaScanManager> media_scan_manager_; | 138 scoped_ptr<MediaScanManager> media_scan_manager_; |
139 scoped_ptr<GalleryWatchManager> gallery_watch_manager_; | 139 scoped_ptr<GalleryWatchManager> gallery_watch_manager_; |
140 | 140 |
141 DISALLOW_COPY_AND_ASSIGN(MediaFileSystemRegistry); | 141 DISALLOW_COPY_AND_ASSIGN(MediaFileSystemRegistry); |
142 }; | 142 }; |
143 | 143 |
144 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_FILE_SYSTEM_REGISTRY_H_ | 144 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_FILE_SYSTEM_REGISTRY_H_ |
OLD | NEW |