Chromium Code Reviews| 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_GALLERY_MEDIA_GALLERIES_PREFERENCES_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_GALLERY_MEDIA_GALLERIES_PREFERENCES_H_ |
| 6 #define CHROME_BROWSER_MEDIA_GALLERY_MEDIA_GALLERIES_PREFERENCES_H_ | 6 #define CHROME_BROWSER_MEDIA_GALLERY_MEDIA_GALLERIES_PREFERENCES_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 29 namespace chrome { | 29 namespace chrome { |
| 30 | 30 |
| 31 typedef uint64 MediaGalleryPrefId; | 31 typedef uint64 MediaGalleryPrefId; |
| 32 const MediaGalleryPrefId kInvalidMediaGalleryPrefId = 0; | 32 const MediaGalleryPrefId kInvalidMediaGalleryPrefId = 0; |
| 33 | 33 |
| 34 struct MediaGalleryPermission { | 34 struct MediaGalleryPermission { |
| 35 MediaGalleryPrefId pref_id; | 35 MediaGalleryPrefId pref_id; |
| 36 bool has_permission; | 36 bool has_permission; |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 struct MediaGalleryPrefInfo { | 39 struct MediaGalleryPrefInfo { |
|
vandebo (ex-Chrome)
2012/09/12 18:19:57
Adding this method means this should become a clas
| |
| 40 enum Type { | 40 enum Type { |
| 41 kAutoDetected, // Auto added to the list of galleries. | 41 kAutoDetected, // Auto added to the list of galleries. |
| 42 kUserAdded, // Explicitly added by the user. | 42 kUserAdded, // Explicitly added by the user. |
| 43 kBlackListed, // Auto added but then removed by the user. | 43 kBlackListed, // Auto added but then removed by the user. |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 MediaGalleryPrefInfo(); | 46 MediaGalleryPrefInfo(); |
| 47 ~MediaGalleryPrefInfo(); | 47 ~MediaGalleryPrefInfo(); |
| 48 | 48 |
| 49 // The ID that identifies this gallery in this Profile. | 49 // The ID that identifies this gallery in this Profile. |
| 50 MediaGalleryPrefId pref_id; | 50 MediaGalleryPrefId pref_id; |
| 51 | 51 |
| 52 // The user-visible name of this gallery. | 52 // The user-visible name of this gallery. |
| 53 string16 display_name; | 53 string16 display_name; |
| 54 | 54 |
| 55 // A string which uniquely and persistently identifies the device that the | 55 // A string which uniquely and persistently identifies the device that the |
| 56 // gallery lives on. | 56 // gallery lives on. |
| 57 std::string device_id; | 57 std::string device_id; |
| 58 | 58 |
| 59 // The root of the gallery, relative to the root of the device. | 59 // The root of the gallery, relative to the root of the device. |
| 60 FilePath path; | 60 FilePath path; |
| 61 | 61 |
| 62 // The absolute path of the gallery. | |
| 63 FilePath AbsolutePath() const; | |
|
vandebo (ex-Chrome)
2012/09/12 18:19:57
nit: methods before members - move to line 49
| |
| 64 | |
| 62 // The type of gallery. | 65 // The type of gallery. |
| 63 Type type; | 66 Type type; |
| 64 }; | 67 }; |
| 65 | 68 |
| 66 typedef std::map<MediaGalleryPrefId, MediaGalleryPrefInfo> | 69 typedef std::map<MediaGalleryPrefId, MediaGalleryPrefInfo> |
| 67 MediaGalleriesPrefInfoMap; | 70 MediaGalleriesPrefInfoMap; |
| 68 typedef std::set<MediaGalleryPrefId> MediaGalleryPrefIdSet; | 71 typedef std::set<MediaGalleryPrefId> MediaGalleryPrefIdSet; |
| 69 | 72 |
| 70 // A class to manage the media gallery preferences. There is one instance per | 73 // A class to manage the media gallery preferences. There is one instance per |
| 71 // user profile. | 74 // user profile. |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 134 DeviceIdPrefIdsMap device_map_; | 137 DeviceIdPrefIdsMap device_map_; |
| 135 | 138 |
| 136 extensions::ExtensionPrefs* GetExtensionPrefs() const; | 139 extensions::ExtensionPrefs* GetExtensionPrefs() const; |
| 137 | 140 |
| 138 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesPreferences); | 141 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesPreferences); |
| 139 }; | 142 }; |
| 140 | 143 |
| 141 } // namespace chrome | 144 } // namespace chrome |
| 142 | 145 |
| 143 #endif // CHROME_BROWSER_MEDIA_GALLERY_MEDIA_GALLERIES_PREFERENCES_H_ | 146 #endif // CHROME_BROWSER_MEDIA_GALLERY_MEDIA_GALLERIES_PREFERENCES_H_ |
| OLD | NEW |