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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 content::WebContents* contents, | 88 content::WebContents* contents, |
90 const extensions::Extension* extension, | 89 const extensions::Extension* extension, |
91 MediaGalleryPrefId pref_id, | 90 MediaGalleryPrefId pref_id, |
92 const base::Callback<void(base::File::Error result)>& callback); | 91 const base::Callback<void(base::File::Error result)>& callback); |
93 | 92 |
94 // Returns the media galleries preferences for the specified |profile|. | 93 // Returns the media galleries preferences for the specified |profile|. |
95 // Caller is responsible for ensuring that the preferences are initialized | 94 // Caller is responsible for ensuring that the preferences are initialized |
96 // before use. | 95 // before use. |
97 MediaGalleriesPreferences* GetPreferences(Profile* profile); | 96 MediaGalleriesPreferences* GetPreferences(Profile* profile); |
98 | 97 |
99 MediaScanManager* media_scan_manager(); | |
100 GalleryWatchManager* gallery_watch_manager(); | 98 GalleryWatchManager* gallery_watch_manager(); |
101 | 99 |
102 // RemovableStorageObserver implementation. | 100 // RemovableStorageObserver implementation. |
103 void OnRemovableStorageDetached( | 101 void OnRemovableStorageDetached( |
104 const storage_monitor::StorageInfo& info) override; | 102 const storage_monitor::StorageInfo& info) override; |
105 | 103 |
106 private: | 104 private: |
107 class MediaFileSystemContextImpl; | 105 class MediaFileSystemContextImpl; |
108 | 106 |
109 friend class MediaFileSystemContextImpl; | 107 friend class MediaFileSystemContextImpl; |
(...skipping 29 matching lines...) Expand all Loading... |
139 | 137 |
140 // This map owns all the ExtensionGalleriesHost objects created. | 138 // This map owns all the ExtensionGalleriesHost objects created. |
141 ExtensionGalleriesHostMap extension_hosts_map_; | 139 ExtensionGalleriesHostMap extension_hosts_map_; |
142 | 140 |
143 // The above map uses raw Profile pointers as keys. This map removes those | 141 // The above map uses raw Profile pointers as keys. This map removes those |
144 // entries when the Profile is destroyed. | 142 // entries when the Profile is destroyed. |
145 ProfileSubscriptionMap profile_subscription_map_; | 143 ProfileSubscriptionMap profile_subscription_map_; |
146 | 144 |
147 scoped_ptr<MediaFileSystemContext> file_system_context_; | 145 scoped_ptr<MediaFileSystemContext> file_system_context_; |
148 | 146 |
149 scoped_ptr<MediaScanManager> media_scan_manager_; | |
150 scoped_ptr<GalleryWatchManager> gallery_watch_manager_; | 147 scoped_ptr<GalleryWatchManager> gallery_watch_manager_; |
151 | 148 |
152 DISALLOW_COPY_AND_ASSIGN(MediaFileSystemRegistry); | 149 DISALLOW_COPY_AND_ASSIGN(MediaFileSystemRegistry); |
153 }; | 150 }; |
154 | 151 |
155 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_FILE_SYSTEM_REGISTRY_H_ | 152 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_FILE_SYSTEM_REGISTRY_H_ |
OLD | NEW |