Chromium Code Reviews| Index: chromeos/dbus/shill_manager_client.cc |
| diff --git a/chromeos/dbus/shill_manager_client.cc b/chromeos/dbus/shill_manager_client.cc |
| index 6b946a1f76055d54c5d6cdd00cab5beb482ec6ed..30213bed412306670264d69b4c86459f7303b904 100644 |
| --- a/chromeos/dbus/shill_manager_client.cc |
| +++ b/chromeos/dbus/shill_manager_client.cc |
| @@ -82,6 +82,13 @@ class ShillManagerClientImpl : public ShillManagerClient { |
| return helper_.CallDictionaryValueMethodAndBlock(&method_call); |
| } |
| + virtual void GetNetworksForGeolocation( |
| + const DictionaryValueCallback& callback) OVERRIDE { |
| + dbus::MethodCall method_call(flimflam::kFlimflamManagerInterface, |
| + shill::kGetNetworksForGeolocation); |
| + helper_.CallDictionaryValueMethod(&method_call, callback); |
| + } |
| + |
| virtual void SetProperty(const std::string& name, |
| const base::Value& value, |
| const base::Closure& callback, |
| @@ -221,6 +228,17 @@ class ShillManagerClientStubImpl : public ShillManagerClient, |
| return stub_properties_.DeepCopy(); |
| } |
| + virtual void GetNetworksForGeolocation( |
| + const DictionaryValueCallback& callback) OVERRIDE { |
| + if (callback.is_null()) |
| + return; |
| + MessageLoop::current()->PostTask( |
| + FROM_HERE, base::Bind( |
| + &ShillManagerClientStubImpl::PassStubGeoNetworks, |
| + weak_ptr_factory_.GetWeakPtr(), |
| + callback)); |
| + } |
| + |
| virtual void SetProperty(const std::string& name, |
| const base::Value& value, |
| const base::Closure& callback, |
| @@ -328,6 +346,10 @@ class ShillManagerClientStubImpl : public ShillManagerClient, |
| } |
| } |
| + virtual void ResetDevices() OVERRIDE { |
| + stub_properties_.Remove(flimflam::kDevicesProperty, NULL); |
| + } |
| + |
| virtual void AddService(const std::string& service_path, |
| bool add_to_watch_list) OVERRIDE { |
| if (GetListProperty(flimflam::kServicesProperty)->AppendIfNotPresent( |
| @@ -401,6 +423,17 @@ class ShillManagerClientStubImpl : public ShillManagerClient, |
| stub_properties_.Clear(); |
| } |
| + virtual void AddGeoNetwork(const std::string& technology, |
| + const base::DictionaryValue& network) OVERRIDE { |
| + base::ListValue* list_value = NULL; |
| + if (!stub_geo_networks_.GetListWithoutPathExpansion( |
| + technology, &list_value)) { |
| + list_value = new base::ListValue; |
| + stub_geo_networks_.Set(technology, list_value); |
| + } |
| + list_value->Append(network.DeepCopy()); |
| + } |
| + |
| private: |
| void AddServiceToWatchList(const std::string& service_path) { |
| if (GetListProperty( |
| @@ -432,6 +465,10 @@ class ShillManagerClientStubImpl : public ShillManagerClient, |
| callback.Run(DBUS_METHOD_CALL_SUCCESS, stub_properties_); |
| } |
| + void PassStubGeoNetworks(const DictionaryValueCallback& callback) const { |
| + callback.Run(DBUS_METHOD_CALL_SUCCESS, stub_geo_networks_); |
| + } |
| + |
| void CallNotifyObserversPropertyChanged(const std::string& property, |
| int delay_ms) { |
| // Avoid unnecessary delayed task if we have no observers (e.g. during |
| @@ -467,7 +504,11 @@ class ShillManagerClientStubImpl : public ShillManagerClient, |
| return list_property; |
| } |
| + // Dictionary of name -> value |
|
gauravsh
2013/01/14 06:19:59
redundant comment
stevenjb
2013/01/14 19:38:48
I added the comment because it's not actually obvi
|
| base::DictionaryValue stub_properties_; |
| + // Dictionary of technology -> list of property dictionaries |
| + base::DictionaryValue stub_geo_networks_; |
| + |
| ObserverList<ShillPropertyChangedObserver> observer_list_; |
| // Note: This should remain the last member so it'll be destroyed and |