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/extensions/api/system_info_storage/storage_info_provide
r_linux.h" | 5 #include "chrome/browser/extensions/api/system_info_storage/storage_info_provide
r_linux.h" |
6 | 6 |
7 #include <mntent.h> | 7 #include <mntent.h> |
8 #include <sys/vfs.h> | 8 #include <sys/vfs.h> |
9 | 9 |
10 namespace extensions { | 10 namespace extensions { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 } | 83 } |
84 | 84 |
85 // Create a udev device from a block device number. | 85 // Create a udev device from a block device number. |
86 ScopedUdevDeviceObject device(udev_device_new_from_devnum( | 86 ScopedUdevDeviceObject device(udev_device_new_from_devnum( |
87 udev_context_, 'b', stat_info.st_dev)); | 87 udev_context_, 'b', stat_info.st_dev)); |
88 if (!device) | 88 if (!device) |
89 return false; | 89 return false; |
90 if (GetUdevDevicePropertyValue(device, "ID_BUS") == "usb") { | 90 if (GetUdevDevicePropertyValue(device, "ID_BUS") == "usb") { |
91 *type = systeminfo::kStorageTypeRemovable; | 91 *type = systeminfo::kStorageTypeRemovable; |
92 } else if (GetUdevDevicePropertyValue(device, "ID_TYPE") == "disk") { | 92 } else if (GetUdevDevicePropertyValue(device, "ID_TYPE") == "disk") { |
93 *type = systeminfo::kStorageTypeHardDisk; | 93 *type = systeminfo::kStorageTypeFixed; |
94 } else { | 94 } else { |
95 *type = systeminfo::kStorageTypeUnknown; | 95 *type = systeminfo::kStorageTypeUnknown; |
96 } | 96 } |
97 return true; | 97 return true; |
98 } | 98 } |
99 | 99 |
100 // static | 100 // static |
101 StorageInfoProvider* StorageInfoProvider::Get() { | 101 StorageInfoProvider* StorageInfoProvider::Get() { |
102 return StorageInfoProvider::GetInstance<StorageInfoProviderLinux>(); | 102 return StorageInfoProvider::GetInstance<StorageInfoProviderLinux>(); |
103 } | 103 } |
104 | 104 |
105 } // namespace extensions | 105 } // namespace extensions |
OLD | NEW |