| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/storage_monitor/storage_monitor_mac.h" | 5 #include "components/storage_monitor/storage_monitor_mac.h" |
| 6 | 6 |
| 7 #include <stdint.h> |
| 8 |
| 7 #include "base/mac/foundation_util.h" | 9 #include "base/mac/foundation_util.h" |
| 8 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
| 9 #include "base/strings/sys_string_conversions.h" | 11 #include "base/strings/sys_string_conversions.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 11 #include "components/storage_monitor/image_capture_device_manager.h" | 13 #include "components/storage_monitor/image_capture_device_manager.h" |
| 12 #include "components/storage_monitor/media_storage_util.h" | 14 #include "components/storage_monitor/media_storage_util.h" |
| 13 #include "components/storage_monitor/storage_info.h" | 15 #include "components/storage_monitor/storage_info.h" |
| 14 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
| 15 | 17 |
| 16 namespace storage_monitor { | 18 namespace storage_monitor { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 if (device_bsd_name && bsd_name) | 56 if (device_bsd_name && bsd_name) |
| 55 *bsd_name = base::SysCFStringRefToUTF8(device_bsd_name); | 57 *bsd_name = base::SysCFStringRefToUTF8(device_bsd_name); |
| 56 | 58 |
| 57 CFURLRef url = base::mac::GetValueFromDictionary<CFURLRef>( | 59 CFURLRef url = base::mac::GetValueFromDictionary<CFURLRef>( |
| 58 dict, kDADiskDescriptionVolumePathKey); | 60 dict, kDADiskDescriptionVolumePathKey); |
| 59 NSURL* nsurl = base::mac::CFToNSCast(url); | 61 NSURL* nsurl = base::mac::CFToNSCast(url); |
| 60 base::FilePath location = base::mac::NSStringToFilePath([nsurl path]); | 62 base::FilePath location = base::mac::NSStringToFilePath([nsurl path]); |
| 61 CFNumberRef size_number = | 63 CFNumberRef size_number = |
| 62 base::mac::GetValueFromDictionary<CFNumberRef>( | 64 base::mac::GetValueFromDictionary<CFNumberRef>( |
| 63 dict, kDADiskDescriptionMediaSizeKey); | 65 dict, kDADiskDescriptionMediaSizeKey); |
| 64 uint64 size_in_bytes = 0; | 66 uint64_t size_in_bytes = 0; |
| 65 if (size_number) | 67 if (size_number) |
| 66 CFNumberGetValue(size_number, kCFNumberLongLongType, &size_in_bytes); | 68 CFNumberGetValue(size_number, kCFNumberLongLongType, &size_in_bytes); |
| 67 | 69 |
| 68 base::string16 vendor = GetUTF16FromDictionary( | 70 base::string16 vendor = GetUTF16FromDictionary( |
| 69 dict, kDADiskDescriptionDeviceVendorKey); | 71 dict, kDADiskDescriptionDeviceVendorKey); |
| 70 base::string16 model = GetUTF16FromDictionary( | 72 base::string16 model = GetUTF16FromDictionary( |
| 71 dict, kDADiskDescriptionDeviceModelKey); | 73 dict, kDADiskDescriptionDeviceModelKey); |
| 72 base::string16 label = GetUTF16FromDictionary( | 74 base::string16 label = GetUTF16FromDictionary( |
| 73 dict, kDADiskDescriptionVolumeNameKey); | 75 dict, kDADiskDescriptionVolumeNameKey); |
| 74 | 76 |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 } | 384 } |
| 383 } | 385 } |
| 384 return false; | 386 return false; |
| 385 } | 387 } |
| 386 | 388 |
| 387 StorageMonitor* StorageMonitor::CreateInternal() { | 389 StorageMonitor* StorageMonitor::CreateInternal() { |
| 388 return new StorageMonitorMac(); | 390 return new StorageMonitorMac(); |
| 389 } | 391 } |
| 390 | 392 |
| 391 } // namespace storage_monitor | 393 } // namespace storage_monitor |
| OLD | NEW |