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 |
11 #include <map> | 11 #include <map> |
12 #include <string> | 12 #include <string> |
13 #include <utility> | 13 #include <utility> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "base/files/file.h" | 16 #include "base/files/file.h" |
17 #include "base/files/file_path.h" | 17 #include "base/files/file_path.h" |
18 #include "base/macros.h" | 18 #include "base/macros.h" |
19 #include "base/memory/ref_counted.h" | 19 #include "base/memory/ref_counted.h" |
20 #include "base/memory/scoped_ptr.h" | 20 #include "base/memory/scoped_ptr.h" |
21 #include "chrome/browser/media_galleries/media_galleries_preferences.h" | 21 #include "chrome/browser/media_galleries/media_galleries_preferences.h" |
22 #include "components/keyed_service/core/keyed_service_shutdown_notifier.h" | 22 #include "components/keyed_service/core/keyed_service_shutdown_notifier.h" |
23 #include "components/storage_monitor/removable_storage_observer.h" | 23 #include "components/storage_monitor/removable_storage_observer.h" |
24 | 24 |
25 class ExtensionGalleriesHost; | 25 class ExtensionGalleriesHost; |
26 class GalleryWatchManager; | 26 class GalleryWatchManager; |
27 class MediaFileSystemContext; | 27 class MediaFileSystemContext; |
28 class MediaGalleriesPreferences; | 28 class MediaGalleriesPreferences; |
29 class MediaScanManager; | |
30 class Profile; | 29 class Profile; |
31 | 30 |
32 namespace content { | 31 namespace content { |
33 class WebContents; | 32 class WebContents; |
34 } | 33 } |
35 | 34 |
36 namespace extensions { | 35 namespace extensions { |
37 class Extension; | 36 class Extension; |
38 } | 37 } |
39 | 38 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 content::WebContents* contents, | 89 content::WebContents* contents, |
91 const extensions::Extension* extension, | 90 const extensions::Extension* extension, |
92 MediaGalleryPrefId pref_id, | 91 MediaGalleryPrefId pref_id, |
93 const base::Callback<void(base::File::Error result)>& callback); | 92 const base::Callback<void(base::File::Error result)>& callback); |
94 | 93 |
95 // Returns the media galleries preferences for the specified |profile|. | 94 // Returns the media galleries preferences for the specified |profile|. |
96 // Caller is responsible for ensuring that the preferences are initialized | 95 // Caller is responsible for ensuring that the preferences are initialized |
97 // before use. | 96 // before use. |
98 MediaGalleriesPreferences* GetPreferences(Profile* profile); | 97 MediaGalleriesPreferences* GetPreferences(Profile* profile); |
99 | 98 |
100 MediaScanManager* media_scan_manager(); | |
101 GalleryWatchManager* gallery_watch_manager(); | 99 GalleryWatchManager* gallery_watch_manager(); |
102 | 100 |
103 // RemovableStorageObserver implementation. | 101 // RemovableStorageObserver implementation. |
104 void OnRemovableStorageDetached( | 102 void OnRemovableStorageDetached( |
105 const storage_monitor::StorageInfo& info) override; | 103 const storage_monitor::StorageInfo& info) override; |
106 | 104 |
107 private: | 105 private: |
108 class MediaFileSystemContextImpl; | 106 class MediaFileSystemContextImpl; |
109 | 107 |
110 friend class MediaFileSystemContextImpl; | 108 friend class MediaFileSystemContextImpl; |
(...skipping 29 matching lines...) Expand all Loading... |
140 | 138 |
141 // This map owns all the ExtensionGalleriesHost objects created. | 139 // This map owns all the ExtensionGalleriesHost objects created. |
142 ExtensionGalleriesHostMap extension_hosts_map_; | 140 ExtensionGalleriesHostMap extension_hosts_map_; |
143 | 141 |
144 // The above map uses raw Profile pointers as keys. This map removes those | 142 // The above map uses raw Profile pointers as keys. This map removes those |
145 // entries when the Profile is destroyed. | 143 // entries when the Profile is destroyed. |
146 ProfileSubscriptionMap profile_subscription_map_; | 144 ProfileSubscriptionMap profile_subscription_map_; |
147 | 145 |
148 scoped_ptr<MediaFileSystemContext> file_system_context_; | 146 scoped_ptr<MediaFileSystemContext> file_system_context_; |
149 | 147 |
150 scoped_ptr<MediaScanManager> media_scan_manager_; | |
151 scoped_ptr<GalleryWatchManager> gallery_watch_manager_; | 148 scoped_ptr<GalleryWatchManager> gallery_watch_manager_; |
152 | 149 |
153 DISALLOW_COPY_AND_ASSIGN(MediaFileSystemRegistry); | 150 DISALLOW_COPY_AND_ASSIGN(MediaFileSystemRegistry); |
154 }; | 151 }; |
155 | 152 |
156 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_FILE_SYSTEM_REGISTRY_H_ | 153 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_FILE_SYSTEM_REGISTRY_H_ |
OLD | NEW |