| 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 "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 | 10 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 56 |
| 57 bool StorageInfoProviderWin::QueryUnitInfo(const std::string& id, | 57 bool StorageInfoProviderWin::QueryUnitInfo(const std::string& id, |
| 58 StorageUnitInfo* info) { | 58 StorageUnitInfo* info) { |
| 59 DCHECK(info); | 59 DCHECK(info); |
| 60 string16 drive = UTF8ToUTF16(id); | 60 string16 drive = UTF8ToUTF16(id); |
| 61 | 61 |
| 62 std::string type; | 62 std::string type; |
| 63 DWORD ret = GetDriveType(drive.c_str()); | 63 DWORD ret = GetDriveType(drive.c_str()); |
| 64 switch (ret) { | 64 switch (ret) { |
| 65 case DRIVE_FIXED: | 65 case DRIVE_FIXED: |
| 66 type = systeminfo::kStorageTypeHardDisk; | 66 type = systeminfo::kStorageTypeFixed; |
| 67 break; | 67 break; |
| 68 case DRIVE_REMOVABLE: | 68 case DRIVE_REMOVABLE: |
| 69 type = systeminfo::kStorageTypeRemovable; | 69 type = systeminfo::kStorageTypeRemovable; |
| 70 break; | 70 break; |
| 71 case DRIVE_UNKNOWN: | 71 case DRIVE_UNKNOWN: |
| 72 type = systeminfo::kStorageTypeUnknown; | 72 type = systeminfo::kStorageTypeUnknown; |
| 73 break; | 73 break; |
| 74 case DRIVE_CDROM: // CD ROM | 74 case DRIVE_CDROM: // CD ROM |
| 75 case DRIVE_REMOTE: // Remote network drive | 75 case DRIVE_REMOTE: // Remote network drive |
| 76 case DRIVE_NO_ROOT_DIR: // Invalid root path | 76 case DRIVE_NO_ROOT_DIR: // Invalid root path |
| (...skipping 17 matching lines...) Expand all Loading... |
| 94 } | 94 } |
| 95 | 95 |
| 96 } // namespace | 96 } // namespace |
| 97 | 97 |
| 98 // static | 98 // static |
| 99 StorageInfoProvider* StorageInfoProvider::Get() { | 99 StorageInfoProvider* StorageInfoProvider::Get() { |
| 100 return StorageInfoProvider::GetInstance<StorageInfoProviderWin>(); | 100 return StorageInfoProvider::GetInstance<StorageInfoProviderWin>(); |
| 101 } | 101 } |
| 102 | 102 |
| 103 } // namespace extensions | 103 } // namespace extensions |
| OLD | NEW |