Chromium Code Reviews| 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 // StorageMonitorLinux implementation. | 5 // StorageMonitorLinux implementation. |
| 6 | 6 |
| 7 #include "chrome/browser/storage_monitor/storage_monitor_linux.h" | 7 #include "chrome/browser/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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 195 if (MediaStorageUtil::HasDcim(mount_point)) | 195 if (MediaStorageUtil::HasDcim(mount_point)) |
| 196 type = StorageInfo::REMOVABLE_MASS_STORAGE_WITH_DCIM; | 196 type = StorageInfo::REMOVABLE_MASS_STORAGE_WITH_DCIM; |
| 197 else | 197 else |
| 198 type = StorageInfo::REMOVABLE_MASS_STORAGE_NO_DCIM; | 198 type = StorageInfo::REMOVABLE_MASS_STORAGE_NO_DCIM; |
| 199 } | 199 } |
| 200 | 200 |
| 201 results_recorder.set_result(true); | 201 results_recorder.set_result(true); |
| 202 | 202 |
| 203 storage_info.reset(new StorageInfo( | 203 storage_info.reset(new StorageInfo( |
| 204 StorageInfo::MakeDeviceId(type, unique_id), | 204 StorageInfo::MakeDeviceId(type, unique_id), |
| 205 string16(), | |
|
vandebo (ex-Chrome)
2013/07/23 23:28:55
Other storage monitor impls need the same treatmen
Lei Zhang
2013/07/24 05:13:34
Yes, they will once we are happy with the Linux si
| |
| 206 mount_point.value(), | 205 mount_point.value(), |
| 207 volume_label, | 206 volume_label, |
| 208 vendor_name, | 207 vendor_name, |
| 209 model_name, | 208 model_name, |
| 210 GetDeviceStorageSize(device_path, device.get()))); | 209 GetDeviceStorageSize(device_path, device.get()))); |
| 211 return storage_info.Pass(); | 210 return storage_info.Pass(); |
| 212 } | 211 } |
| 213 | 212 |
| 214 MtabWatcherLinux* CreateMtabWatcherLinuxOnFileThread( | 213 MtabWatcherLinux* CreateMtabWatcherLinuxOnFileThread( |
| 215 const base::FilePath& mtab_path, | 214 const base::FilePath& mtab_path, |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 512 mount_priority_map_[mount_device][mount_point] = removable; | 511 mount_priority_map_[mount_device][mount_point] = removable; |
| 513 receiver()->ProcessAttach(*storage_info); | 512 receiver()->ProcessAttach(*storage_info); |
| 514 } | 513 } |
| 515 | 514 |
| 516 StorageMonitor* StorageMonitor::Create() { | 515 StorageMonitor* StorageMonitor::Create() { |
| 517 const base::FilePath kDefaultMtabPath("/etc/mtab"); | 516 const base::FilePath kDefaultMtabPath("/etc/mtab"); |
| 518 return new StorageMonitorLinux(kDefaultMtabPath); | 517 return new StorageMonitorLinux(kDefaultMtabPath); |
| 519 } | 518 } |
| 520 | 519 |
| 521 } // namespace chrome | 520 } // namespace chrome |
| OLD | NEW |