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/system_monitor/disk_info_mac.h" | 5 #include "chrome/browser/system_monitor/disk_info_mac.h" |
6 | 6 |
7 #include "base/mac/foundation_util.h" | 7 #include "base/mac/foundation_util.h" |
8 #include "base/sys_string_conversions.h" | 8 #include "base/sys_string_conversions.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/system_monitor/media_device_notifications_utils.h" | 10 #include "chrome/browser/system_monitor/media_device_notifications_utils.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 bool is_removable = is_removable_ref && CFBooleanGetValue(is_removable_ref); | 107 bool is_removable = is_removable_ref && CFBooleanGetValue(is_removable_ref); |
108 // Checking for DCIM only matters on removable devices. | 108 // Checking for DCIM only matters on removable devices. |
109 bool has_dcim = is_removable && IsMediaDevice(info.mount_point_.value()); | 109 bool has_dcim = is_removable && IsMediaDevice(info.mount_point_.value()); |
110 info.type_ = GetDeviceType(is_removable, has_dcim); | 110 info.type_ = GetDeviceType(is_removable, has_dcim); |
111 if (!unique_id.empty()) | 111 if (!unique_id.empty()) |
112 info.device_id_ = MediaStorageUtil::MakeDeviceId(info.type_, unique_id); | 112 info.device_id_ = MediaStorageUtil::MakeDeviceId(info.type_, unique_id); |
113 | 113 |
114 return info; | 114 return info; |
115 } | 115 } |
116 | 116 |
| 117 //static |
| 118 DiskInfoMac DiskInfoMac::BuildDiskInfoFromICDevice(std::string device_id, |
| 119 string16 device_name, |
| 120 FilePath mount_point) { |
| 121 DiskInfoMac info; |
| 122 info.device_id_ = device_id; |
| 123 info.device_name_ = device_name; |
| 124 info.mount_point_ = mount_point; |
| 125 info.type_ = MediaStorageUtil::MAC_IMAGE_CAPTURE; |
| 126 return info; |
| 127 } |
| 128 |
117 } // namesapce chrome | 129 } // namesapce chrome |
OLD | NEW |