Chromium Code Reviews| Index: chromeos/dbus/shill_service_client_stub.cc |
| diff --git a/chromeos/dbus/shill_service_client_stub.cc b/chromeos/dbus/shill_service_client_stub.cc |
| index db59bf31f6368e949d0afa2995b4471250c69605..82fba7d241e7cc593a443e38de2f9b057ebe0d35 100644 |
| --- a/chromeos/dbus/shill_service_client_stub.cc |
| +++ b/chromeos/dbus/shill_service_client_stub.cc |
| @@ -131,11 +131,7 @@ void ShillServiceClientStub::ClearProperty( |
| error_callback.Run("Error.InvalidService", "Invalid Service"); |
| return; |
| } |
| - dict->Remove(name, NULL); |
| - base::MessageLoop::current()->PostTask( |
| - FROM_HERE, |
| - base::Bind(&ShillServiceClientStub::NotifyObserversPropertyChanged, |
| - weak_ptr_factory_.GetWeakPtr(), service_path, name)); |
|
Mattias Nissler (ping if slow)
2013/07/29 10:08:15
Why did you remove this?
pneubeck (no reviews)
2013/07/29 13:15:08
NotifyObserversPropertyChanged always failed in th
|
| + dict->RemoveWithoutPathExpansion(name, NULL); |
| base::MessageLoop::current()->PostTask(FROM_HERE, callback); |
| } |
| @@ -366,12 +362,28 @@ bool ShillServiceClientStub::SetServiceProperty(const std::string& service_path, |
| MoveServiceToIndex(service_path, 0, true); |
| } |
| } |
| - dict->SetWithoutPathExpansion(property, value.DeepCopy()); |
| + base::DictionaryValue new_properties; |
| + std::string property_changed; |
|
Mattias Nissler (ping if slow)
2013/07/29 10:08:15
nit: property_changed suggests a bool, how about c
pneubeck (no reviews)
2013/07/29 13:15:08
Done.
|
| + if (property == flimflam::kOpenVPNCaCertNSSProperty || |
| + property == flimflam::kOpenVPNCaCertNSSProperty) { |
| + // These properties are only nested within the Provider dictionary if read |
| + // from Shill. |
| + base::DictionaryValue* provider = new base::DictionaryValue; |
| + provider->SetWithoutPathExpansion(property, value.DeepCopy()); |
| + new_properties.SetWithoutPathExpansion(flimflam::kProviderProperty, |
| + provider); |
| + property_changed = flimflam::kProviderProperty; |
| + } else { |
| + new_properties.SetWithoutPathExpansion(property, value.DeepCopy()); |
| + property_changed = property; |
| + } |
| + |
| + dict->MergeDictionary(&new_properties); |
| base::MessageLoop::current()->PostTask( |
| FROM_HERE, |
| base::Bind(&ShillServiceClientStub::NotifyObserversPropertyChanged, |
| weak_ptr_factory_.GetWeakPtr(), |
| - dbus::ObjectPath(service_path), property)); |
| + dbus::ObjectPath(service_path), property_changed)); |
| return true; |
| } |