| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/storage_monitor/test_storage_monitor.h" | 5 #include "components/storage_monitor/test_storage_monitor.h" |
| 6 | 6 |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "base/synchronization/waitable_event.h" | 8 #include "base/synchronization/waitable_event.h" |
| 9 #include "components/storage_monitor/storage_info.h" | 9 #include "components/storage_monitor/storage_info.h" |
| 10 | 10 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 const base::FilePath& path, | 80 const base::FilePath& path, |
| 81 StorageInfo* device_info) const { | 81 StorageInfo* device_info) const { |
| 82 DCHECK(device_info); | 82 DCHECK(device_info); |
| 83 | 83 |
| 84 if (!path.IsAbsolute()) | 84 if (!path.IsAbsolute()) |
| 85 return false; | 85 return false; |
| 86 | 86 |
| 87 std::string device_id = StorageInfo::MakeDeviceId( | 87 std::string device_id = StorageInfo::MakeDeviceId( |
| 88 StorageInfo::FIXED_MASS_STORAGE, path.AsUTF8Unsafe()); | 88 StorageInfo::FIXED_MASS_STORAGE, path.AsUTF8Unsafe()); |
| 89 *device_info = | 89 *device_info = |
| 90 StorageInfo(device_id, path.BaseName().LossyDisplayName(), path.value(), | 90 StorageInfo(device_id, path.value(), base::string16(), base::string16(), |
| 91 base::string16(), base::string16(), base::string16(), 0); | 91 base::string16(), 0); |
| 92 return true; | 92 return true; |
| 93 } | 93 } |
| 94 | 94 |
| 95 #if defined(OS_WIN) | 95 #if defined(OS_WIN) |
| 96 bool TestStorageMonitor::GetMTPStorageInfoFromDeviceId( | 96 bool TestStorageMonitor::GetMTPStorageInfoFromDeviceId( |
| 97 const std::string& storage_device_id, | 97 const std::string& storage_device_id, |
| 98 base::string16* device_location, | 98 base::string16* device_location, |
| 99 base::string16* storage_object_id) const { | 99 base::string16* storage_object_id) const { |
| 100 return false; | 100 return false; |
| 101 } | 101 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 113 } | 113 } |
| 114 | 114 |
| 115 void TestStorageMonitor::EjectDevice( | 115 void TestStorageMonitor::EjectDevice( |
| 116 const std::string& device_id, | 116 const std::string& device_id, |
| 117 base::Callback<void(EjectStatus)> callback) { | 117 base::Callback<void(EjectStatus)> callback) { |
| 118 ejected_device_ = device_id; | 118 ejected_device_ = device_id; |
| 119 callback.Run(EJECT_OK); | 119 callback.Run(EJECT_OK); |
| 120 } | 120 } |
| 121 | 121 |
| 122 } // namespace storage_monitor | 122 } // namespace storage_monitor |
| OLD | NEW |