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

Side by Side Diff: chrome/browser/system_monitor/media_storage_util.cc

Issue 10918259: [Chrome OS]Implement MediaStorageUtil::GetDeviceInfoForPath function to support media gallery permi… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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 // chrome::MediaStorageUtil implementation. 5 // chrome::MediaStorageUtil implementation.
6 6
7 #include "chrome/browser/system_monitor/media_storage_util.h" 7 #include "chrome/browser/system_monitor/media_storage_util.h"
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 } 177 }
178 178
179 // static 179 // static
180 void MediaStorageUtil::SetGetDeviceInfoFromPathFunctionForTesting( 180 void MediaStorageUtil::SetGetDeviceInfoFromPathFunctionForTesting(
181 GetDeviceInfoFromPathFunction function) { 181 GetDeviceInfoFromPathFunction function) {
182 g_test_get_device_info_from_path_function = function; 182 g_test_get_device_info_from_path_function = function;
183 } 183 }
184 184
185 MediaStorageUtil::MediaStorageUtil() {} 185 MediaStorageUtil::MediaStorageUtil() {}
186 186
187 #if !defined(OS_LINUX) || defined(OS_CHROMEOS) 187 #if !defined(OS_LINUX)
188 // static 188 // static
189 void MediaStorageUtil::GetDeviceInfoFromPathImpl(const FilePath& path, 189 void MediaStorageUtil::GetDeviceInfoFromPathImpl(const FilePath& path,
190 std::string* device_id, 190 std::string* device_id,
191 string16* device_name, 191 string16* device_name,
192 FilePath* relative_path) { 192 FilePath* relative_path) {
193 // TODO(vandebo) This needs to be implemented per platform. Below is no 193 // TODO(vandebo) This needs to be implemented per platform. Below is no
194 // worse than what the code already does. 194 // worse than what the code already does.
195 // * Find mount point parent (determines relative file path) 195 // * Find mount point parent (determines relative file path)
196 // * Search System monitor, just in case. 196 // * Search System monitor, just in case.
197 // * If it's a removable device, generate device id, else use device root 197 // * If it's a removable device, generate device id, else use device root
198 // path as id 198 // path as id
199 if (device_id) 199 if (device_id)
200 *device_id = MakeDeviceId(FIXED_MASS_STORAGE, path.AsUTF8Unsafe()); 200 *device_id = MakeDeviceId(FIXED_MASS_STORAGE, path.AsUTF8Unsafe());
201 if (device_name) 201 if (device_name)
202 *device_name = path.BaseName().LossyDisplayName(); 202 *device_name = path.BaseName().LossyDisplayName();
203 if (relative_path) 203 if (relative_path)
204 *relative_path = FilePath(); 204 *relative_path = FilePath();
205 } 205 }
206 #endif 206 #endif
207 207
208 } // namespace chrome 208 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698