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 "chromeos/dbus/fake_cros_disks_client.h" | 5 #include "chromeos/dbus/fake_cros_disks_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 FROM_HERE, unmount_success_ ? callback : error_callback); | 44 FROM_HERE, unmount_success_ ? callback : error_callback); |
45 if (!unmount_listener_.is_null()) | 45 if (!unmount_listener_.is_null()) |
46 unmount_listener_.Run(); | 46 unmount_listener_.Run(); |
47 } | 47 } |
48 | 48 |
49 void FakeCrosDisksClient::EnumerateAutoMountableDevices( | 49 void FakeCrosDisksClient::EnumerateAutoMountableDevices( |
50 const EnumerateAutoMountableDevicesCallback& callback, | 50 const EnumerateAutoMountableDevicesCallback& callback, |
51 const base::Closure& error_callback) { | 51 const base::Closure& error_callback) { |
52 } | 52 } |
53 | 53 |
| 54 void FakeCrosDisksClient::EnumerateMountEntries( |
| 55 const EnumerateMountEntriesCallback& callback, |
| 56 const base::Closure& error_callback) { |
| 57 } |
| 58 |
54 void FakeCrosDisksClient::Format(const std::string& device_path, | 59 void FakeCrosDisksClient::Format(const std::string& device_path, |
55 const std::string& filesystem, | 60 const std::string& filesystem, |
56 const base::Closure& callback, | 61 const base::Closure& callback, |
57 const base::Closure& error_callback) { | 62 const base::Closure& error_callback) { |
58 DCHECK(!callback.is_null()); | 63 DCHECK(!callback.is_null()); |
59 DCHECK(!error_callback.is_null()); | 64 DCHECK(!error_callback.is_null()); |
60 | 65 |
61 format_call_count_++; | 66 format_call_count_++; |
62 last_format_device_path_ = device_path; | 67 last_format_device_path_ = device_path; |
63 last_format_filesystem_ = filesystem; | 68 last_format_filesystem_ = filesystem; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 return true; | 102 return true; |
98 } | 103 } |
99 | 104 |
100 bool FakeCrosDisksClient::SendMountCompletedEvent( | 105 bool FakeCrosDisksClient::SendMountCompletedEvent( |
101 MountError error_code, | 106 MountError error_code, |
102 const std::string& source_path, | 107 const std::string& source_path, |
103 MountType mount_type, | 108 MountType mount_type, |
104 const std::string& mount_path) { | 109 const std::string& mount_path) { |
105 if (mount_completed_handler_.is_null()) | 110 if (mount_completed_handler_.is_null()) |
106 return false; | 111 return false; |
107 mount_completed_handler_.Run(error_code, source_path, mount_type, mount_path); | 112 mount_completed_handler_.Run( |
| 113 MountEntry(error_code, source_path, mount_type, mount_path)); |
108 return true; | 114 return true; |
109 } | 115 } |
110 | 116 |
111 bool FakeCrosDisksClient::SendFormatCompletedEvent( | 117 bool FakeCrosDisksClient::SendFormatCompletedEvent( |
112 FormatError error_code, | 118 FormatError error_code, |
113 const std::string& device_path) { | 119 const std::string& device_path) { |
114 if (format_completed_handler_.is_null()) | 120 if (format_completed_handler_.is_null()) |
115 return false; | 121 return false; |
116 format_completed_handler_.Run(error_code, device_path); | 122 format_completed_handler_.Run(error_code, device_path); |
117 return true; | 123 return true; |
118 } | 124 } |
119 | 125 |
120 } // namespace chromeos | 126 } // namespace chromeos |
OLD | NEW |