OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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_debug_daemon_client.h" | 5 #include "chromeos/dbus/fake_debug_daemon_client.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 } | 136 } |
137 | 137 |
138 void FakeDebugDaemonClient::GetUserLogFiles(const GetLogsCallback& callback) { | 138 void FakeDebugDaemonClient::GetUserLogFiles(const GetLogsCallback& callback) { |
139 std::map<std::string, std::string> user_logs; | 139 std::map<std::string, std::string> user_logs; |
140 user_logs["preferences"] = "Preferences"; | 140 user_logs["preferences"] = "Preferences"; |
141 user_logs["invalid_file"] = "Invalid File"; | 141 user_logs["invalid_file"] = "Invalid File"; |
142 base::ThreadTaskRunnerHandle::Get()->PostTask( | 142 base::ThreadTaskRunnerHandle::Get()->PostTask( |
143 FROM_HERE, base::Bind(callback, true, user_logs)); | 143 FROM_HERE, base::Bind(callback, true, user_logs)); |
144 } | 144 } |
145 | 145 |
| 146 void FakeDebugDaemonClient::GetLog(const std::string& log_name, |
| 147 const GetLogCallback& callback) { |
| 148 std::string result = log_name + ": response from GetLog"; |
| 149 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 150 FROM_HERE, base::Bind(callback, true, result)); |
| 151 } |
| 152 |
146 void FakeDebugDaemonClient::TestICMP(const std::string& ip_address, | 153 void FakeDebugDaemonClient::TestICMP(const std::string& ip_address, |
147 const TestICMPCallback& callback) { | 154 const TestICMPCallback& callback) { |
148 base::ThreadTaskRunnerHandle::Get()->PostTask( | 155 base::ThreadTaskRunnerHandle::Get()->PostTask( |
149 FROM_HERE, base::Bind(callback, false, "")); | 156 FROM_HERE, base::Bind(callback, false, "")); |
150 } | 157 } |
151 | 158 |
152 void FakeDebugDaemonClient::TestICMPWithOptions( | 159 void FakeDebugDaemonClient::TestICMPWithOptions( |
153 const std::string& ip_address, | 160 const std::string& ip_address, |
154 const std::map<std::string, std::string>& options, | 161 const std::map<std::string, std::string>& options, |
155 const TestICMPCallback& callback) { | 162 const TestICMPCallback& callback) { |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 const base::Closure& error_callback) { | 252 const base::Closure& error_callback) { |
246 const bool has_printer = base::ContainsKey(printers_, name); | 253 const bool has_printer = base::ContainsKey(printers_, name); |
247 if (has_printer) | 254 if (has_printer) |
248 printers_.erase(name); | 255 printers_.erase(name); |
249 | 256 |
250 base::ThreadTaskRunnerHandle::Get()->PostTask( | 257 base::ThreadTaskRunnerHandle::Get()->PostTask( |
251 FROM_HERE, base::Bind(callback, has_printer)); | 258 FROM_HERE, base::Bind(callback, has_printer)); |
252 } | 259 } |
253 | 260 |
254 } // namespace chromeos | 261 } // namespace chromeos |
OLD | NEW |