Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1122)

Unified Diff: chromeos/dbus/shill_service_client_stub.cc

Issue 20087002: Add migration from CaCert NSS nicknames to PEM. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unittests depending on NetworkHandler and not on CertLoader. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/chromeos.gyp ('k') | chromeos/network/network_cert_migrator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 38ac5adefbca99426bc85b0817a2d59be0f7c302..c2bac7fc55fd9deae3562267c0876d21d3f0460b 100644
--- a/chromeos/dbus/shill_service_client_stub.cc
+++ b/chromeos/dbus/shill_service_client_stub.cc
@@ -8,6 +8,7 @@
#include "base/command_line.h"
#include "base/message_loop/message_loop.h"
#include "base/stl_util.h"
+#include "base/strings/string_util.h"
#include "base/values.h"
#include "chromeos/chromeos_switches.h"
#include "chromeos/dbus/dbus_thread_manager.h"
@@ -356,12 +357,30 @@ bool ShillServiceClientStub::SetServiceProperty(const std::string& service_path,
MoveServiceToIndex(service_path, 0, true);
}
}
- dict->SetWithoutPathExpansion(property, value.DeepCopy());
+ base::DictionaryValue new_properties;
+ std::string changed_property;
+ bool case_sensitive = true;
+ if (StartsWithASCII(property, "Provider.", case_sensitive) ||
+ StartsWithASCII(property, "OpenVPN.", case_sensitive) ||
+ StartsWithASCII(property, "L2TPIPsec.", case_sensitive)) {
+ // 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);
+ changed_property = flimflam::kProviderProperty;
+ } else {
+ new_properties.SetWithoutPathExpansion(property, value.DeepCopy());
+ changed_property = 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), changed_property));
return true;
}
« no previous file with comments | « chromeos/chromeos.gyp ('k') | chromeos/network/network_cert_migrator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698