| 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 // StorageMonitorLinux implementation. | 5 // StorageMonitorLinux implementation. |
| 6 | 6 |
| 7 #include "components/storage_monitor/storage_monitor_linux.h" | 7 #include "components/storage_monitor/storage_monitor_linux.h" |
| 8 | 8 |
| 9 #include <mntent.h> | 9 #include <mntent.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 if (MediaStorageUtil::HasDcim(mount_point)) | 176 if (MediaStorageUtil::HasDcim(mount_point)) |
| 177 type = StorageInfo::REMOVABLE_MASS_STORAGE_WITH_DCIM; | 177 type = StorageInfo::REMOVABLE_MASS_STORAGE_WITH_DCIM; |
| 178 else | 178 else |
| 179 type = StorageInfo::REMOVABLE_MASS_STORAGE_NO_DCIM; | 179 type = StorageInfo::REMOVABLE_MASS_STORAGE_NO_DCIM; |
| 180 } | 180 } |
| 181 | 181 |
| 182 results_recorder.set_result(true); | 182 results_recorder.set_result(true); |
| 183 | 183 |
| 184 storage_info.reset(new StorageInfo( | 184 storage_info.reset(new StorageInfo( |
| 185 StorageInfo::MakeDeviceId(type, unique_id), | 185 StorageInfo::MakeDeviceId(type, unique_id), |
| 186 base::string16(), | |
| 187 mount_point.value(), | 186 mount_point.value(), |
| 188 volume_label, | 187 volume_label, |
| 189 vendor_name, | 188 vendor_name, |
| 190 model_name, | 189 model_name, |
| 191 GetDeviceStorageSize(device_path, device.get()))); | 190 GetDeviceStorageSize(device_path, device.get()))); |
| 192 return storage_info.Pass(); | 191 return storage_info.Pass(); |
| 193 } | 192 } |
| 194 | 193 |
| 195 MtabWatcherLinux* CreateMtabWatcherLinuxOnFileThread( | 194 MtabWatcherLinux* CreateMtabWatcherLinuxOnFileThread( |
| 196 const base::FilePath& mtab_path, | 195 const base::FilePath& mtab_path, |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 mount_priority_map_[mount_device][mount_point] = removable; | 497 mount_priority_map_[mount_device][mount_point] = removable; |
| 499 receiver()->ProcessAttach(*storage_info); | 498 receiver()->ProcessAttach(*storage_info); |
| 500 } | 499 } |
| 501 | 500 |
| 502 StorageMonitor* StorageMonitor::CreateInternal() { | 501 StorageMonitor* StorageMonitor::CreateInternal() { |
| 503 const base::FilePath kDefaultMtabPath("/etc/mtab"); | 502 const base::FilePath kDefaultMtabPath("/etc/mtab"); |
| 504 return new StorageMonitorLinux(kDefaultMtabPath); | 503 return new StorageMonitorLinux(kDefaultMtabPath); |
| 505 } | 504 } |
| 506 | 505 |
| 507 } // namespace storage_monitor | 506 } // namespace storage_monitor |
| OLD | NEW |