| 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_chromeos.h" | 5 #include "components/storage_monitor/storage_monitor_chromeos.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 base::string16 device_label = base::UTF8ToUTF16(disk->device_label()); | 61 base::string16 device_label = base::UTF8ToUTF16(disk->device_label()); |
| 62 MediaStorageUtil::RecordDeviceInfoHistogram(true, unique_id, device_label); | 62 MediaStorageUtil::RecordDeviceInfoHistogram(true, unique_id, device_label); |
| 63 if (unique_id.empty()) | 63 if (unique_id.empty()) |
| 64 return false; | 64 return false; |
| 65 | 65 |
| 66 StorageInfo::Type type = has_dcim ? | 66 StorageInfo::Type type = has_dcim ? |
| 67 StorageInfo::REMOVABLE_MASS_STORAGE_WITH_DCIM : | 67 StorageInfo::REMOVABLE_MASS_STORAGE_WITH_DCIM : |
| 68 StorageInfo::REMOVABLE_MASS_STORAGE_NO_DCIM; | 68 StorageInfo::REMOVABLE_MASS_STORAGE_NO_DCIM; |
| 69 | 69 |
| 70 *info = StorageInfo(StorageInfo::MakeDeviceId(type, unique_id), | 70 *info = StorageInfo(StorageInfo::MakeDeviceId(type, unique_id), |
| 71 base::string16(), | |
| 72 mount_info.mount_path, | 71 mount_info.mount_path, |
| 73 device_label, | 72 device_label, |
| 74 base::UTF8ToUTF16(disk->vendor_name()), | 73 base::UTF8ToUTF16(disk->vendor_name()), |
| 75 base::UTF8ToUTF16(disk->product_name()), | 74 base::UTF8ToUTF16(disk->product_name()), |
| 76 disk->total_size_in_bytes()); | 75 disk->total_size_in_bytes()); |
| 77 return true; | 76 return true; |
| 78 } | 77 } |
| 79 | 78 |
| 80 // Returns whether the mount point in |mount_info| is a media device or not. | 79 // Returns whether the mount point in |mount_info| is a media device or not. |
| 81 bool CheckMountedPathOnFileThread( | 80 bool CheckMountedPathOnFileThread( |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 mount_map_.insert(std::make_pair(mount_info.mount_path, info)); | 297 mount_map_.insert(std::make_pair(mount_info.mount_path, info)); |
| 299 | 298 |
| 300 receiver()->ProcessAttach(info); | 299 receiver()->ProcessAttach(info); |
| 301 } | 300 } |
| 302 | 301 |
| 303 StorageMonitor* StorageMonitor::CreateInternal() { | 302 StorageMonitor* StorageMonitor::CreateInternal() { |
| 304 return new StorageMonitorCros(); | 303 return new StorageMonitorCros(); |
| 305 } | 304 } |
| 306 | 305 |
| 307 } // namespace storage_monitor | 306 } // namespace storage_monitor |
| OLD | NEW |