| 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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 #endif | 254 #endif |
| 255 | 255 |
| 256 if (found_device && IsRemovableDevice(device_info.device_id)) { | 256 if (found_device && IsRemovableDevice(device_info.device_id)) { |
| 257 FilePath sub_folder_path; | 257 FilePath sub_folder_path; |
| 258 if (device_name || relative_path) { | 258 if (device_name || relative_path) { |
| 259 bool success = FilePath(device_info.location) | 259 bool success = FilePath(device_info.location) |
| 260 .AppendRelativePath(path, &sub_folder_path); | 260 .AppendRelativePath(path, &sub_folder_path); |
| 261 DCHECK(success); | 261 DCHECK(success); |
| 262 } | 262 } |
| 263 | 263 |
| 264 #if defined(OS_CHROMEOS) | 264 #if defined(OS_LINUX) // Implies OS_CHROMEOS |
| 265 if (device_name) { | 265 if (device_name) { |
| 266 *device_name = notifier->GetStorageSizeInfo(device_info.location) + | 266 *device_name = notifier->GetStorageSizeInfo(device_info.location) + |
| 267 ASCIIToUTF16(" "); | 267 ASCIIToUTF16(" "); |
| 268 if (!sub_folder_path.value().empty()) { | 268 if (!sub_folder_path.value().empty()) { |
| 269 *device_name += ASCIIToUTF16(" (") + | 269 *device_name += ASCIIToUTF16(" (") + |
| 270 sub_folder_path.BaseName().LossyDisplayName() + ASCIIToUTF16(") "); | 270 sub_folder_path.BaseName().LossyDisplayName() + ASCIIToUTF16(") "); |
| 271 } | 271 } |
| 272 } | 272 } |
| 273 #endif | 273 #endif |
| 274 | 274 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 | 339 |
| 340 // static | 340 // static |
| 341 void MediaStorageUtil::SetGetDeviceInfoFromPathFunctionForTesting( | 341 void MediaStorageUtil::SetGetDeviceInfoFromPathFunctionForTesting( |
| 342 GetDeviceInfoFromPathFunction function) { | 342 GetDeviceInfoFromPathFunction function) { |
| 343 g_test_get_device_info_from_path_function = function; | 343 g_test_get_device_info_from_path_function = function; |
| 344 } | 344 } |
| 345 | 345 |
| 346 MediaStorageUtil::MediaStorageUtil() {} | 346 MediaStorageUtil::MediaStorageUtil() {} |
| 347 | 347 |
| 348 } // namespace chrome | 348 } // namespace chrome |
| OLD | NEW |