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/storage_monitor/media_storage_util.h" | 5 #include "chrome/browser/storage_monitor/media_storage_util.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 base::FilePath sub_folder_path; | 305 base::FilePath sub_folder_path; |
306 if (path.value() != info.location) { | 306 if (path.value() != info.location) { |
307 base::FilePath device_path(info.location); | 307 base::FilePath device_path(info.location); |
308 bool success = device_path.AppendRelativePath(path, &sub_folder_path); | 308 bool success = device_path.AppendRelativePath(path, &sub_folder_path); |
309 DCHECK(success); | 309 DCHECK(success); |
310 } | 310 } |
311 | 311 |
312 // TODO(gbillock): Don't do this. Leave for clients to do. | 312 // TODO(gbillock): Don't do this. Leave for clients to do. |
313 #if defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_LINUX) // Implies OS_CH
ROMEOS | 313 #if defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_LINUX) // Implies OS_CH
ROMEOS |
314 info.name = GetDisplayNameForDevice( | 314 info.name = GetDisplayNameForDevice( |
315 monitor->GetStorageSize(info.location), | 315 info.total_size_in_bytes, |
316 GetDisplayNameForSubFolder(info.name, sub_folder_path)); | 316 GetDisplayNameForSubFolder(info.name, sub_folder_path)); |
317 #endif | 317 #endif |
318 | 318 |
319 if (device_info) | 319 if (device_info) |
320 *device_info = info; | 320 *device_info = info; |
321 if (relative_path) | 321 if (relative_path) |
322 *relative_path = sub_folder_path; | 322 *relative_path = sub_folder_path; |
323 | 323 |
324 return true; | 324 return true; |
325 } | 325 } |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 static_cast<enum DeviceInfoHistogramBuckets>(event_number); | 387 static_cast<enum DeviceInfoHistogramBuckets>(event_number); |
388 if (event >= DEVICE_INFO_BUCKET_BOUNDARY) { | 388 if (event >= DEVICE_INFO_BUCKET_BOUNDARY) { |
389 NOTREACHED(); | 389 NOTREACHED(); |
390 return; | 390 return; |
391 } | 391 } |
392 UMA_HISTOGRAM_ENUMERATION("MediaDeviceNotifications.DeviceInfo", event, | 392 UMA_HISTOGRAM_ENUMERATION("MediaDeviceNotifications.DeviceInfo", event, |
393 DEVICE_INFO_BUCKET_BOUNDARY); | 393 DEVICE_INFO_BUCKET_BOUNDARY); |
394 } | 394 } |
395 | 395 |
396 } // namespace chrome | 396 } // namespace chrome |
OLD | NEW |