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 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_PREFERENCES_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_PREFERENCES_H_ |
6 #define CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_PREFERENCES_H_ | 6 #define CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_PREFERENCES_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 bool LookUpGalleryByPath(const base::FilePath& path, | 210 bool LookUpGalleryByPath(const base::FilePath& path, |
211 MediaGalleryPrefInfo* gallery) const; | 211 MediaGalleryPrefInfo* gallery) const; |
212 | 212 |
213 MediaGalleryPrefIdSet LookUpGalleriesByDeviceId( | 213 MediaGalleryPrefIdSet LookUpGalleriesByDeviceId( |
214 const std::string& device_id) const; | 214 const std::string& device_id) const; |
215 | 215 |
216 // Returns the absolute file path of the gallery specified by the | 216 // Returns the absolute file path of the gallery specified by the |
217 // |gallery_id|. Returns an empty file path if the |gallery_id| is invalid. | 217 // |gallery_id|. Returns an empty file path if the |gallery_id| is invalid. |
218 // Set |include_unpermitted_galleries| to true to get the file path of the | 218 // Set |include_unpermitted_galleries| to true to get the file path of the |
219 // gallery to which this |extension| has no access permission. | 219 // gallery to which this |extension| has no access permission. |
220 // | |
221 // TODO(tommycli): Remove this function after Media Galleries API Private | |
222 // is transitioned over to public. Also, the body of the function wrong. | |
223 // It just returns the absolute path to the device, not the gallery. | |
224 base::FilePath LookUpGalleryPathForExtension( | 220 base::FilePath LookUpGalleryPathForExtension( |
225 MediaGalleryPrefId gallery_id, | 221 MediaGalleryPrefId gallery_id, |
226 const extensions::Extension* extension, | 222 const extensions::Extension* extension, |
227 bool include_unpermitted_galleries); | 223 bool include_unpermitted_galleries); |
228 | 224 |
229 // Teaches the registry about a new gallery. If the gallery is in a | 225 // Teaches the registry about a new gallery. If the gallery is in a |
230 // blacklisted state, it is unblacklisted. |type| should not be a blacklisted | 226 // blacklisted state, it is unblacklisted. |type| should not be a blacklisted |
231 // type. Returns the gallery's pref id. | 227 // type. Returns the gallery's pref id. |
232 MediaGalleryPrefId AddGallery(const std::string& device_id, | 228 MediaGalleryPrefId AddGallery(const std::string& device_id, |
233 const base::FilePath& relative_path, | 229 const base::FilePath& relative_path, |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 DeviceIdPrefIdsMap device_map_; | 393 DeviceIdPrefIdsMap device_map_; |
398 | 394 |
399 base::ObserverList<GalleryChangeObserver> gallery_change_observers_; | 395 base::ObserverList<GalleryChangeObserver> gallery_change_observers_; |
400 | 396 |
401 base::WeakPtrFactory<MediaGalleriesPreferences> weak_factory_; | 397 base::WeakPtrFactory<MediaGalleriesPreferences> weak_factory_; |
402 | 398 |
403 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesPreferences); | 399 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesPreferences); |
404 }; | 400 }; |
405 | 401 |
406 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_PREFERENCES_H_ | 402 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_PREFERENCES_H_ |
OLD | NEW |