Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: chrome/browser/storage_monitor/test_storage_monitor.cc

Issue 15294020: StorageMonitor: Make StorageInfo a real class. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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_name = StorageInfo::MakeDeviceId(
Greg Billock 2013/05/22 23:39:00 "device_id"
Lei Zhang 2013/05/23 16:44:49 Done.
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_name, path.BaseName().LossyDisplayName(),
54 device_info->total_size_in_bytes = 0; 54 path.value(), 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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698