| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 // TestVolumeMountWatcherWin implementation. | 5 // TestVolumeMountWatcherWin implementation. |
| 6 | 6 |
| 7 #include "chrome/browser/storage_monitor/test_volume_mount_watcher_win.h" | 7 #include "chrome/browser/storage_monitor/test_volume_mount_watcher_win.h" |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 if (path.value()[0] < L'A' || path.value()[0] > L'Z') { | 50 if (path.value()[0] < L'A' || path.value()[0] > L'Z') { |
| 51 return false; | 51 return false; |
| 52 } | 52 } |
| 53 | 53 |
| 54 if (device_location) | 54 if (device_location) |
| 55 *device_location = path.value(); | 55 *device_location = path.value(); |
| 56 if (total_size_in_bytes) | 56 if (total_size_in_bytes) |
| 57 *total_size_in_bytes = 1000000; | 57 *total_size_in_bytes = 1000000; |
| 58 if (unique_id) { | 58 if (unique_id) { |
| 59 *unique_id = "\\\\?\\Volume{00000000-0000-0000-0000-000000000000}\\"; | 59 *unique_id = "\\\\?\\Volume{00000000-0000-0000-0000-000000000000}\\"; |
| 60 (*unique_id)[11] = path.value()[0]; | 60 (*unique_id)[11] = device_path.value()[0]; |
| 61 } | 61 } |
| 62 if (name) | 62 if (name) |
| 63 *name = path.Append(L" Drive").LossyDisplayName(); | 63 *name = path.Append(L" Drive").LossyDisplayName(); |
| 64 if (removable) { | 64 if (removable) { |
| 65 *removable = (path.value() != ASCIIToUTF16("N:\\") && | 65 *removable = (path.value() != ASCIIToUTF16("N:\\") && |
| 66 path.value() != ASCIIToUTF16("C:\\")); | 66 path.value() != ASCIIToUTF16("C:\\")); |
| 67 } | 67 } |
| 68 return true; | 68 return true; |
| 69 } | 69 } |
| 70 | 70 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 string16* name, | 144 string16* name, |
| 145 bool* removable, | 145 bool* removable, |
| 146 uint64* total_size_in_bytes) { | 146 uint64* total_size_in_bytes) { |
| 147 return GetMassStorageDeviceDetails( | 147 return GetMassStorageDeviceDetails( |
| 148 device_path, device_location, unique_id, name, removable, | 148 device_path, device_location, unique_id, name, removable, |
| 149 total_size_in_bytes); | 149 total_size_in_bytes); |
| 150 } | 150 } |
| 151 | 151 |
| 152 } // namespace test | 152 } // namespace test |
| 153 } // namespace chrome | 153 } // namespace chrome |
| OLD | NEW |