| 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_device_client.h" |    5 #include "chromeos/dbus/shill_device_client.h" | 
|    6  |    6  | 
|    7 #include "base/bind.h" |    7 #include "base/bind.h" | 
|    8 #include "base/message_loop.h" |    8 #include "base/message_loop.h" | 
|    9 #include "base/stl_util.h" |    9 #include "base/stl_util.h" | 
|   10 #include "base/values.h" |   10 #include "base/values.h" | 
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   93       const dbus::ObjectPath& device_path, |   93       const dbus::ObjectPath& device_path, | 
|   94       const std::string& method, |   94       const std::string& method, | 
|   95       const ObjectPathDBusMethodCallback& callback) OVERRIDE { |   95       const ObjectPathDBusMethodCallback& callback) OVERRIDE { | 
|   96     dbus::MethodCall method_call(flimflam::kFlimflamDeviceInterface, |   96     dbus::MethodCall method_call(flimflam::kFlimflamDeviceInterface, | 
|   97                                  flimflam::kAddIPConfigFunction); |   97                                  flimflam::kAddIPConfigFunction); | 
|   98     dbus::MessageWriter writer(&method_call); |   98     dbus::MessageWriter writer(&method_call); | 
|   99     writer.AppendString(method); |   99     writer.AppendString(method); | 
|  100     GetHelper(device_path)->CallObjectPathMethod(&method_call, callback); |  100     GetHelper(device_path)->CallObjectPathMethod(&method_call, callback); | 
|  101   } |  101   } | 
|  102  |  102  | 
|  103   virtual dbus::ObjectPath CallAddIPConfigAndBlock( |  | 
|  104       const dbus::ObjectPath& device_path, |  | 
|  105       const std::string& method) OVERRIDE { |  | 
|  106     dbus::MethodCall method_call(flimflam::kFlimflamDeviceInterface, |  | 
|  107                                  flimflam::kAddIPConfigFunction); |  | 
|  108     dbus::MessageWriter writer(&method_call); |  | 
|  109     writer.AppendString(method); |  | 
|  110     return GetHelper(device_path)->CallObjectPathMethodAndBlock(&method_call); |  | 
|  111   } |  | 
|  112  |  | 
|  113   virtual void RequirePin(const dbus::ObjectPath& device_path, |  103   virtual void RequirePin(const dbus::ObjectPath& device_path, | 
|  114                           const std::string& pin, |  104                           const std::string& pin, | 
|  115                           bool require, |  105                           bool require, | 
|  116                           const base::Closure& callback, |  106                           const base::Closure& callback, | 
|  117                           const ErrorCallback& error_callback) OVERRIDE { |  107                           const ErrorCallback& error_callback) OVERRIDE { | 
|  118     dbus::MethodCall method_call(flimflam::kFlimflamDeviceInterface, |  108     dbus::MethodCall method_call(flimflam::kFlimflamDeviceInterface, | 
|  119                                  flimflam::kRequirePinFunction); |  109                                  flimflam::kRequirePinFunction); | 
|  120     dbus::MessageWriter writer(&method_call); |  110     dbus::MessageWriter writer(&method_call); | 
|  121     writer.AppendString(pin); |  111     writer.AppendString(pin); | 
|  122     writer.AppendBool(require); |  112     writer.AppendBool(require); | 
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  305   virtual void AddIPConfig( |  295   virtual void AddIPConfig( | 
|  306       const dbus::ObjectPath& device_path, |  296       const dbus::ObjectPath& device_path, | 
|  307       const std::string& method, |  297       const std::string& method, | 
|  308       const ObjectPathDBusMethodCallback& callback) OVERRIDE { |  298       const ObjectPathDBusMethodCallback& callback) OVERRIDE { | 
|  309     MessageLoop::current()->PostTask(FROM_HERE, |  299     MessageLoop::current()->PostTask(FROM_HERE, | 
|  310                                      base::Bind(callback, |  300                                      base::Bind(callback, | 
|  311                                                 DBUS_METHOD_CALL_SUCCESS, |  301                                                 DBUS_METHOD_CALL_SUCCESS, | 
|  312                                                 dbus::ObjectPath())); |  302                                                 dbus::ObjectPath())); | 
|  313   } |  303   } | 
|  314  |  304  | 
|  315   virtual dbus::ObjectPath CallAddIPConfigAndBlock( |  | 
|  316       const dbus::ObjectPath& device_path, |  | 
|  317       const std::string& method) OVERRIDE { |  | 
|  318     return dbus::ObjectPath(); |  | 
|  319   } |  | 
|  320  |  | 
|  321   virtual void RequirePin(const dbus::ObjectPath& device_path, |  305   virtual void RequirePin(const dbus::ObjectPath& device_path, | 
|  322                           const std::string& pin, |  306                           const std::string& pin, | 
|  323                           bool require, |  307                           bool require, | 
|  324                           const base::Closure& callback, |  308                           const base::Closure& callback, | 
|  325                           const ErrorCallback& error_callback) OVERRIDE { |  309                           const ErrorCallback& error_callback) OVERRIDE { | 
|  326     MessageLoop::current()->PostTask(FROM_HERE, callback); |  310     MessageLoop::current()->PostTask(FROM_HERE, callback); | 
|  327   } |  311   } | 
|  328  |  312  | 
|  329   virtual void EnterPin(const dbus::ObjectPath& device_path, |  313   virtual void EnterPin(const dbus::ObjectPath& device_path, | 
|  330                         const std::string& pin, |  314                         const std::string& pin, | 
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  487 ShillDeviceClient* ShillDeviceClient::Create( |  471 ShillDeviceClient* ShillDeviceClient::Create( | 
|  488     DBusClientImplementationType type, |  472     DBusClientImplementationType type, | 
|  489     dbus::Bus* bus) { |  473     dbus::Bus* bus) { | 
|  490   if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) |  474   if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | 
|  491     return new ShillDeviceClientImpl(bus); |  475     return new ShillDeviceClientImpl(bus); | 
|  492   DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); |  476   DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | 
|  493   return new ShillDeviceClientStubImpl(); |  477   return new ShillDeviceClientStubImpl(); | 
|  494 } |  478 } | 
|  495  |  479  | 
|  496 }  // namespace chromeos |  480 }  // namespace chromeos | 
| OLD | NEW |