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.h" | 5 #include "chrome/browser/extensions/api/system_info_storage/storage_info_provide
r.h" |
6 | 6 |
7 #include <CoreFoundation/CoreFoundation.h> | 7 #include <CoreFoundation/CoreFoundation.h> |
8 #include <IOKit/IOBSD.h> | 8 #include <IOKit/IOBSD.h> |
9 #include <IOKit/IOKitLib.h> | 9 #include <IOKit/IOKitLib.h> |
10 #include <IOKit/storage/IOMedia.h> | 10 #include <IOKit/storage/IOMedia.h> |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 base::mac::ScopedCFTypeRef<CFTypeRef> removable_cf( | 122 base::mac::ScopedCFTypeRef<CFTypeRef> removable_cf( |
123 IORegistryEntryCreateCFProperty(media, | 123 IORegistryEntryCreateCFProperty(media, |
124 CFSTR(kIOMediaEjectableKey), | 124 CFSTR(kIOMediaEjectableKey), |
125 kCFAllocatorDefault, | 125 kCFAllocatorDefault, |
126 0)); | 126 0)); |
127 if (!removable_cf) | 127 if (!removable_cf) |
128 dev_path_to_type_map_[dev_path] = systeminfo::kStorageTypeUnknown; | 128 dev_path_to_type_map_[dev_path] = systeminfo::kStorageTypeUnknown; |
129 else if (CFBooleanGetValue(base::mac::CFCast<CFBooleanRef>(removable_cf))) | 129 else if (CFBooleanGetValue(base::mac::CFCast<CFBooleanRef>(removable_cf))) |
130 dev_path_to_type_map_[dev_path] = systeminfo::kStorageTypeRemovable; | 130 dev_path_to_type_map_[dev_path] = systeminfo::kStorageTypeRemovable; |
131 else | 131 else |
132 dev_path_to_type_map_[dev_path] = systeminfo::kStorageTypeHardDisk; | 132 dev_path_to_type_map_[dev_path] = systeminfo::kStorageTypeFixed; |
133 } | 133 } |
134 } | 134 } |
135 | 135 |
136 } // namespace | 136 } // namespace |
137 | 137 |
138 // static | 138 // static |
139 StorageInfoProvider* StorageInfoProvider::Get() { | 139 StorageInfoProvider* StorageInfoProvider::Get() { |
140 return StorageInfoProvider::GetInstance<StorageInfoProviderMac>(); | 140 return StorageInfoProvider::GetInstance<StorageInfoProviderMac>(); |
141 } | 141 } |
142 | 142 |
143 } // namespace extensions | 143 } // namespace extensions |
OLD | NEW |