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 // 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 *device_id = device_info.device_id; | 259 *device_id = device_info.device_id; |
260 | 260 |
261 FilePath sub_folder_path; | 261 FilePath sub_folder_path; |
262 if (device_name || relative_path) { | 262 if (device_name || relative_path) { |
263 bool success = FilePath(device_info.location) | 263 bool success = FilePath(device_info.location) |
264 .AppendRelativePath(path, &sub_folder_path); | 264 .AppendRelativePath(path, &sub_folder_path); |
265 DCHECK(success); | 265 DCHECK(success); |
266 } | 266 } |
267 | 267 |
268 if (device_name) { | 268 if (device_name) { |
269 #if defined(OS_CHROMEOS) | 269 #if defined(OS_LINUX) // Implies OS_CHROMEOS |
270 *device_name = GetDisplayNameForDevice( | 270 *device_name = GetDisplayNameForDevice( |
271 notifier->GetStorageSize(device_info.location), | 271 notifier->GetStorageSize(device_info.location), |
272 sub_folder_path.value().empty() ? | 272 sub_folder_path.value().empty() ? |
273 device_info.name : | 273 device_info.name : |
274 sub_folder_path.BaseName().LossyDisplayName() + | 274 sub_folder_path.BaseName().LossyDisplayName() + |
275 ASCIIToUTF16(" - ") + device_info.name); | 275 ASCIIToUTF16(" - ") + device_info.name); |
276 #else | 276 #else |
277 *device_name = device_info.name; | 277 *device_name = device_info.name; |
278 #endif | 278 #endif |
279 } | 279 } |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 | 341 |
342 // static | 342 // static |
343 void MediaStorageUtil::SetGetDeviceInfoFromPathFunctionForTesting( | 343 void MediaStorageUtil::SetGetDeviceInfoFromPathFunctionForTesting( |
344 GetDeviceInfoFromPathFunction function) { | 344 GetDeviceInfoFromPathFunction function) { |
345 g_test_get_device_info_from_path_function = function; | 345 g_test_get_device_info_from_path_function = function; |
346 } | 346 } |
347 | 347 |
348 MediaStorageUtil::MediaStorageUtil() {} | 348 MediaStorageUtil::MediaStorageUtil() {} |
349 | 349 |
350 } // namespace chrome | 350 } // namespace chrome |
OLD | NEW |