Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(598)

Side by Side Diff: chrome/browser/media_gallery/media_galleries_preferences.cc

Issue 10911242: make media gallery directory tooltips in media gallery config dialog absolute paths (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698