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 #include "chrome/browser/media_gallery/media_gallery_registry.h" | 5 #include "chrome/browser/media_gallery/media_gallery_registry.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 DictionaryValue* dict = new DictionaryValue(); | 51 DictionaryValue* dict = new DictionaryValue(); |
52 dict->SetString(kMediaGalleryIdKey, base::Uint64ToString(gallery.id)); | 52 dict->SetString(kMediaGalleryIdKey, base::Uint64ToString(gallery.id)); |
53 dict->SetString(kMediaGalleryPathKey, gallery.path.value()); | 53 dict->SetString(kMediaGalleryPathKey, gallery.path.value()); |
54 // TODO(estade): save |path| and |identifier|. | 54 // TODO(estade): save |path| and |identifier|. |
55 dict->SetString(kMediaGalleryDisplayNameKey, gallery.display_name); | 55 dict->SetString(kMediaGalleryDisplayNameKey, gallery.display_name); |
56 return dict; | 56 return dict; |
57 } | 57 } |
58 | 58 |
59 } // namespace | 59 } // namespace |
60 | 60 |
61 MediaGallery::MediaGallery() {} | 61 MediaGallery::MediaGallery() : id(0) {} |
62 MediaGallery::~MediaGallery() {} | 62 MediaGallery::~MediaGallery() {} |
63 | 63 |
64 MediaGalleryRegistry::MediaGalleryRegistry(Profile* profile) | 64 MediaGalleryRegistry::MediaGalleryRegistry(Profile* profile) |
65 : profile_(profile) { | 65 : profile_(profile) { |
66 DCHECK(UserInteractionIsEnabled()); | 66 DCHECK(UserInteractionIsEnabled()); |
67 InitFromPrefs(); | 67 InitFromPrefs(); |
68 } | 68 } |
69 | 69 |
70 MediaGalleryRegistry::~MediaGalleryRegistry() {} | 70 MediaGalleryRegistry::~MediaGalleryRegistry() {} |
71 | 71 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // static | 135 // static |
136 void MediaGalleryRegistry::RegisterUserPrefs(PrefService* prefs) { | 136 void MediaGalleryRegistry::RegisterUserPrefs(PrefService* prefs) { |
137 if (!UserInteractionIsEnabled()) | 137 if (!UserInteractionIsEnabled()) |
138 return; | 138 return; |
139 | 139 |
140 prefs->RegisterListPref(prefs::kMediaGalleryRememberedGalleries, | 140 prefs->RegisterListPref(prefs::kMediaGalleryRememberedGalleries, |
141 PrefService::UNSYNCABLE_PREF); | 141 PrefService::UNSYNCABLE_PREF); |
142 prefs->RegisterUint64Pref(prefs::kMediaGalleryUniqueId, 0, | 142 prefs->RegisterUint64Pref(prefs::kMediaGalleryUniqueId, 0, |
143 PrefService::UNSYNCABLE_PREF); | 143 PrefService::UNSYNCABLE_PREF); |
144 } | 144 } |
OLD | NEW |