OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/shill_manager_client.h" | 5 #include "chromeos/dbus/shill_manager_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/chromeos/chromeos_version.h" | 8 #include "base/chromeos/chromeos_version.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
205 writer.AppendString(public_key); | 205 writer.AppendString(public_key); |
206 writer.AppendString(nonce); | 206 writer.AppendString(nonce); |
207 writer.AppendString(signed_data); | 207 writer.AppendString(signed_data); |
208 writer.AppendString(device_serial); | 208 writer.AppendString(device_serial); |
209 writer.AppendObjectPath(dbus::ObjectPath(service_path)); | 209 writer.AppendObjectPath(dbus::ObjectPath(service_path)); |
210 helper_.CallStringMethodWithErrorCallback(&method_call, | 210 helper_.CallStringMethodWithErrorCallback(&method_call, |
211 callback, | 211 callback, |
212 error_callback); | 212 error_callback); |
213 } | 213 } |
214 | 214 |
215 virtual void VerifyAndEncryptData(const std::string& certificate, | 215 virtual void VerifyAndEncryptData( |
216 const std::string& public_key, | 216 const std::string& certificate, |
217 const std::string& nonce, | 217 const std::string& public_key, |
218 const std::string& signed_data, | 218 const std::string& nonce, |
219 const std::string& device_serial, | 219 const std::string& signed_data, |
220 const std::string& data, | 220 const std::string& device_serial, |
221 const StringCallback& callback, | 221 const std::string& data, |
222 const ErrorCallback& error_callback) OVERRIDE { | 222 const StringCallback& callback, |
223 const ErrorCallback& error_callback) OVERRIDE { | |
223 dbus::MethodCall method_call(flimflam::kFlimflamManagerInterface, | 224 dbus::MethodCall method_call(flimflam::kFlimflamManagerInterface, |
224 shill::kVerifyAndEncryptDataFunction); | 225 shill::kVerifyAndEncryptDataFunction); |
225 dbus::MessageWriter writer(&method_call); | 226 dbus::MessageWriter writer(&method_call); |
226 writer.AppendString(certificate); | 227 writer.AppendString(certificate); |
227 writer.AppendString(public_key); | 228 writer.AppendString(public_key); |
228 writer.AppendString(nonce); | 229 writer.AppendString(nonce); |
229 writer.AppendString(signed_data); | 230 writer.AppendString(signed_data); |
230 writer.AppendString(device_serial); | 231 writer.AppendString(device_serial); |
231 writer.AppendString(data); | 232 writer.AppendString(data); |
232 helper_.CallStringMethodWithErrorCallback(&method_call, | 233 helper_.CallStringMethodWithErrorCallback(&method_call, |
233 callback, | 234 callback, |
234 error_callback); | 235 error_callback); |
235 } | 236 } |
236 | 237 |
238 virtual void ConnectToBestServices( | |
239 const base::Closure& callback, | |
240 const ErrorCallback& error_callback) OVERRIDE { | |
241 dbus::MethodCall method_call(flimflam::kFlimflamManagerInterface, | |
242 "ConnectToBestServices"); | |
stevenjb
2013/03/27 21:37:54
Note: this needs to be replaced with the shill con
| |
243 helper_.CallVoidMethodWithErrorCallback(&method_call, | |
244 callback, | |
245 error_callback); | |
246 } | |
247 | |
237 virtual TestInterface* GetTestInterface() OVERRIDE { | 248 virtual TestInterface* GetTestInterface() OVERRIDE { |
238 return NULL; | 249 return NULL; |
239 } | 250 } |
240 | 251 |
241 private: | 252 private: |
242 dbus::ObjectProxy* proxy_; | 253 dbus::ObjectProxy* proxy_; |
243 ShillClientHelper helper_; | 254 ShillClientHelper helper_; |
244 | 255 |
245 DISALLOW_COPY_AND_ASSIGN(ShillManagerClientImpl); | 256 DISALLOW_COPY_AND_ASSIGN(ShillManagerClientImpl); |
246 }; | 257 }; |
247 | 258 |
248 } // namespace | 259 } // namespace |
249 | 260 |
250 ShillManagerClient::ShillManagerClient() {} | 261 ShillManagerClient::ShillManagerClient() {} |
251 | 262 |
252 ShillManagerClient::~ShillManagerClient() {} | 263 ShillManagerClient::~ShillManagerClient() {} |
253 | 264 |
254 // static | 265 // static |
255 ShillManagerClient* ShillManagerClient::Create( | 266 ShillManagerClient* ShillManagerClient::Create( |
256 DBusClientImplementationType type, | 267 DBusClientImplementationType type, |
257 dbus::Bus* bus) { | 268 dbus::Bus* bus) { |
258 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | 269 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) |
259 return new ShillManagerClientImpl(bus); | 270 return new ShillManagerClientImpl(bus); |
260 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | 271 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); |
261 return new ShillManagerClientStub(); | 272 return new ShillManagerClientStub(); |
262 } | 273 } |
263 | 274 |
264 } // namespace chromeos | 275 } // namespace chromeos |
OLD | NEW |