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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 if (MediaStorageUtil::HasDcim(mount_point)) | 192 if (MediaStorageUtil::HasDcim(mount_point)) |
193 type = StorageInfo::REMOVABLE_MASS_STORAGE_WITH_DCIM; | 193 type = StorageInfo::REMOVABLE_MASS_STORAGE_WITH_DCIM; |
194 else | 194 else |
195 type = StorageInfo::REMOVABLE_MASS_STORAGE_NO_DCIM; | 195 type = StorageInfo::REMOVABLE_MASS_STORAGE_NO_DCIM; |
196 } | 196 } |
197 | 197 |
198 results_recorder.set_result(true); | 198 results_recorder.set_result(true); |
199 | 199 |
200 storage_info.reset(new StorageInfo( | 200 storage_info.reset(new StorageInfo( |
201 StorageInfo::MakeDeviceId(type, unique_id), | 201 StorageInfo::MakeDeviceId(type, unique_id), |
202 string16(), | |
203 mount_point.value(), | 202 mount_point.value(), |
204 volume_label, | 203 volume_label, |
205 vendor_name, | 204 vendor_name, |
206 model_name, | 205 model_name, |
207 GetDeviceStorageSize(device_path, device.get()))); | 206 GetDeviceStorageSize(device_path, device.get()))); |
208 return storage_info.Pass(); | 207 return storage_info.Pass(); |
209 } | 208 } |
210 | 209 |
211 MtabWatcherLinux* CreateMtabWatcherLinuxOnFileThread( | 210 MtabWatcherLinux* CreateMtabWatcherLinuxOnFileThread( |
212 const base::FilePath& mtab_path, | 211 const base::FilePath& mtab_path, |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 mount_priority_map_[mount_device][mount_point] = removable; | 502 mount_priority_map_[mount_device][mount_point] = removable; |
504 receiver()->ProcessAttach(*storage_info); | 503 receiver()->ProcessAttach(*storage_info); |
505 } | 504 } |
506 | 505 |
507 StorageMonitor* StorageMonitor::Create() { | 506 StorageMonitor* StorageMonitor::Create() { |
508 const base::FilePath kDefaultMtabPath("/etc/mtab"); | 507 const base::FilePath kDefaultMtabPath("/etc/mtab"); |
509 return new StorageMonitorLinux(kDefaultMtabPath); | 508 return new StorageMonitorLinux(kDefaultMtabPath); |
510 } | 509 } |
511 | 510 |
512 } // namespace chrome | 511 } // namespace chrome |
OLD | NEW |