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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 MediaFileSystemRegistry(); | 69 MediaFileSystemRegistry(); |
70 virtual ~MediaFileSystemRegistry(); | 70 virtual ~MediaFileSystemRegistry(); |
71 | 71 |
72 // Passes to |callback| the list of media filesystem IDs and paths for a | 72 // Passes to |callback| the list of media filesystem IDs and paths for a |
73 // given RVH. Called on the UI thread. | 73 // given RVH. Called on the UI thread. |
74 void GetMediaFileSystemsForExtension( | 74 void GetMediaFileSystemsForExtension( |
75 const content::RenderViewHost* rvh, | 75 const content::RenderViewHost* rvh, |
76 const extensions::Extension* extension, | 76 const extensions::Extension* extension, |
77 const MediaFileSystemsCallback& callback); | 77 const MediaFileSystemsCallback& callback); |
78 | 78 |
79 // Returns the initialized media galleries preferences for the specified | 79 // Returns the media galleries preferences for the specified |profile|. |
80 // |profile|. This method should be used instead of calling | 80 // Called on the UI thread. Caller is responsible for ensuring that the |
81 // MediaGalleriesPreferences directly because this method also ensures that | 81 // preferences are initialized before use. |
82 // currently attached removable devices are added to the preferences. | |
83 // Called on the UI thread. | |
84 // Note: Caller must ensure that the storage monitor is initialized before | |
85 // calling this method. | |
86 MediaGalleriesPreferences* GetPreferences(Profile* profile); | 82 MediaGalleriesPreferences* GetPreferences(Profile* profile); |
87 | 83 |
88 // RemovableStorageObserver implementation. | 84 // RemovableStorageObserver implementation. |
89 virtual void OnRemovableStorageDetached(const StorageInfo& info) OVERRIDE; | 85 virtual void OnRemovableStorageDetached(const StorageInfo& info) OVERRIDE; |
90 | 86 |
91 private: | 87 private: |
92 friend class MediaFileSystemRegistryTest; | 88 friend class MediaFileSystemRegistryTest; |
93 friend class TestMediaFileSystemContext; | 89 friend class TestMediaFileSystemContext; |
94 class MediaFileSystemContextImpl; | 90 class MediaFileSystemContextImpl; |
95 | 91 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 125 |
130 // Only accessed on the UI thread. | 126 // Only accessed on the UI thread. |
131 MTPDeviceDelegateMap mtp_device_delegate_map_; | 127 MTPDeviceDelegateMap mtp_device_delegate_map_; |
132 | 128 |
133 scoped_ptr<MediaFileSystemContext> file_system_context_; | 129 scoped_ptr<MediaFileSystemContext> file_system_context_; |
134 | 130 |
135 DISALLOW_COPY_AND_ASSIGN(MediaFileSystemRegistry); | 131 DISALLOW_COPY_AND_ASSIGN(MediaFileSystemRegistry); |
136 }; | 132 }; |
137 | 133 |
138 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_FILE_SYSTEM_REGISTRY_H_ | 134 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_FILE_SYSTEM_REGISTRY_H_ |
OLD | NEW |