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 #include "chrome/browser/storage_monitor/test_storage_monitor.h" | 5 #include "chrome/browser/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 "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/browser_process_impl.h" | 10 #include "chrome/browser/browser_process_impl.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 bool TestStorageMonitor::GetStorageInfoForPath( | 92 bool TestStorageMonitor::GetStorageInfoForPath( |
93 const base::FilePath& path, | 93 const base::FilePath& path, |
94 StorageInfo* device_info) const { | 94 StorageInfo* device_info) const { |
95 DCHECK(device_info); | 95 DCHECK(device_info); |
96 | 96 |
97 if (!path.IsAbsolute()) | 97 if (!path.IsAbsolute()) |
98 return false; | 98 return false; |
99 | 99 |
100 std::string device_id = StorageInfo::MakeDeviceId( | 100 std::string device_id = StorageInfo::MakeDeviceId( |
101 StorageInfo::FIXED_MASS_STORAGE, path.AsUTF8Unsafe()); | 101 StorageInfo::FIXED_MASS_STORAGE, path.AsUTF8Unsafe()); |
102 *device_info = | 102 *device_info = StorageInfo(device_id, path.value(), base::string16(), |
103 StorageInfo(device_id, path.BaseName().LossyDisplayName(), path.value(), | 103 base::string16(), base::string16(), 0); |
104 string16(), string16(), string16(), 0); | |
105 return true; | 104 return true; |
106 } | 105 } |
107 | 106 |
108 #if defined(OS_WIN) | 107 #if defined(OS_WIN) |
109 bool TestStorageMonitor::GetMTPStorageInfoFromDeviceId( | 108 bool TestStorageMonitor::GetMTPStorageInfoFromDeviceId( |
110 const std::string& storage_device_id, | 109 const std::string& storage_device_id, |
111 string16* device_location, | 110 string16* device_location, |
112 string16* storage_object_id) const { | 111 string16* storage_object_id) const { |
113 return false; | 112 return false; |
114 } | 113 } |
(...skipping 12 matching lines...) Expand all Loading... |
127 | 126 |
128 void TestStorageMonitor::EjectDevice( | 127 void TestStorageMonitor::EjectDevice( |
129 const std::string& device_id, | 128 const std::string& device_id, |
130 base::Callback<void(EjectStatus)> callback) { | 129 base::Callback<void(EjectStatus)> callback) { |
131 ejected_device_ = device_id; | 130 ejected_device_ = device_id; |
132 callback.Run(EJECT_OK); | 131 callback.Run(EJECT_OK); |
133 } | 132 } |
134 | 133 |
135 } // namespace test | 134 } // namespace test |
136 } // namespace chrome | 135 } // namespace chrome |
OLD | NEW |