| 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_galleries_preferences.h" | 5 #include "chrome/browser/media_gallery/media_galleries_preferences.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 return dict; | 117 return dict; |
| 118 } | 118 } |
| 119 | 119 |
| 120 } // namespace | 120 } // namespace |
| 121 | 121 |
| 122 MediaGalleryPrefInfo::MediaGalleryPrefInfo() | 122 MediaGalleryPrefInfo::MediaGalleryPrefInfo() |
| 123 : pref_id(kInvalidMediaGalleryPrefId) { | 123 : pref_id(kInvalidMediaGalleryPrefId) { |
| 124 } | 124 } |
| 125 MediaGalleryPrefInfo::~MediaGalleryPrefInfo() {} | 125 MediaGalleryPrefInfo::~MediaGalleryPrefInfo() {} |
| 126 | 126 |
| 127 FilePath MediaGalleryPrefInfo::AbsolutePath() const { |
| 128 FilePath base_path = MediaStorageUtil::FindDevicePathById(device_id); |
| 129 return base_path.Append(path); |
| 130 } |
| 131 |
| 127 MediaGalleriesPreferences::MediaGalleriesPreferences(Profile* profile) | 132 MediaGalleriesPreferences::MediaGalleriesPreferences(Profile* profile) |
| 128 : profile_(profile) { | 133 : profile_(profile) { |
| 129 // Populate the default galleries if this is a fresh profile. | 134 // Populate the default galleries if this is a fresh profile. |
| 130 MediaGalleryPrefId current_id = | 135 MediaGalleryPrefId current_id = |
| 131 profile_->GetPrefs()->GetUint64(prefs::kMediaGalleriesUniqueId); | 136 profile_->GetPrefs()->GetUint64(prefs::kMediaGalleriesUniqueId); |
| 132 if (current_id == kInvalidMediaGalleryPrefId + 1) { | 137 if (current_id == kInvalidMediaGalleryPrefId + 1) { |
| 133 FilePath pictures_path; | 138 FilePath pictures_path; |
| 134 if (PathService::Get(chrome::DIR_USER_PICTURES, &pictures_path)) { | 139 if (PathService::Get(chrome::DIR_USER_PICTURES, &pictures_path)) { |
| 135 std::string device_id; | 140 std::string device_id; |
| 136 string16 display_name; | 141 string16 display_name; |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 } | 393 } |
| 389 | 394 |
| 390 extensions::ExtensionPrefs* | 395 extensions::ExtensionPrefs* |
| 391 MediaGalleriesPreferences::GetExtensionPrefs() const { | 396 MediaGalleriesPreferences::GetExtensionPrefs() const { |
| 392 ExtensionService* extension_service = | 397 ExtensionService* extension_service = |
| 393 extensions::ExtensionSystem::Get(profile_)->extension_service(); | 398 extensions::ExtensionSystem::Get(profile_)->extension_service(); |
| 394 return extension_service->extension_prefs(); | 399 return extension_service->extension_prefs(); |
| 395 } | 400 } |
| 396 | 401 |
| 397 } // namespace chrome | 402 } // namespace chrome |
| OLD | NEW |