| 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 "chrome/browser/storage_monitor/storage_info.h" | 7 #include "chrome/browser/storage_monitor/storage_info.h" |
| 8 | 8 |
| 9 #if defined(OS_LINUX) | 9 #if defined(OS_LINUX) |
| 10 #include "chrome/browser/storage_monitor/test_media_transfer_protocol_manager_li
nux.h" | 10 #include "chrome/browser/storage_monitor/test_media_transfer_protocol_manager_li
nux.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 } | 40 } |
| 41 | 41 |
| 42 bool TestStorageMonitor::GetStorageInfoForPath( | 42 bool TestStorageMonitor::GetStorageInfoForPath( |
| 43 const base::FilePath& path, | 43 const base::FilePath& path, |
| 44 StorageInfo* device_info) const { | 44 StorageInfo* device_info) const { |
| 45 DCHECK(device_info); | 45 DCHECK(device_info); |
| 46 | 46 |
| 47 if (!path.IsAbsolute()) | 47 if (!path.IsAbsolute()) |
| 48 return false; | 48 return false; |
| 49 | 49 |
| 50 device_info->device_id = StorageInfo::MakeDeviceId( | 50 std::string device_id = StorageInfo::MakeDeviceId( |
| 51 StorageInfo::FIXED_MASS_STORAGE, path.AsUTF8Unsafe()); | 51 StorageInfo::FIXED_MASS_STORAGE, path.AsUTF8Unsafe()); |
| 52 device_info->name = path.BaseName().LossyDisplayName(); | 52 *device_info = |
| 53 device_info->location = path.value(); | 53 StorageInfo(device_id, path.BaseName().LossyDisplayName(), path.value(), |
| 54 device_info->total_size_in_bytes = 0; | 54 string16(), string16(), string16(), 0); |
| 55 return true; | 55 return true; |
| 56 } | 56 } |
| 57 | 57 |
| 58 #if defined(OS_WIN) | 58 #if defined(OS_WIN) |
| 59 bool TestStorageMonitor::GetMTPStorageInfoFromDeviceId( | 59 bool TestStorageMonitor::GetMTPStorageInfoFromDeviceId( |
| 60 const std::string& storage_device_id, | 60 const std::string& storage_device_id, |
| 61 string16* device_location, | 61 string16* device_location, |
| 62 string16* storage_object_id) const { | 62 string16* storage_object_id) const { |
| 63 return false; | 63 return false; |
| 64 } | 64 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 77 | 77 |
| 78 void TestStorageMonitor::EjectDevice( | 78 void TestStorageMonitor::EjectDevice( |
| 79 const std::string& device_id, | 79 const std::string& device_id, |
| 80 base::Callback<void(EjectStatus)> callback) { | 80 base::Callback<void(EjectStatus)> callback) { |
| 81 ejected_device_ = device_id; | 81 ejected_device_ = device_id; |
| 82 callback.Run(EJECT_OK); | 82 callback.Run(EJECT_OK); |
| 83 } | 83 } |
| 84 | 84 |
| 85 } // namespace test | 85 } // namespace test |
| 86 } // namespace chrome | 86 } // namespace chrome |
| OLD | NEW |