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

Unified Diff: chromeos/dbus/shill_manager_client.cc

Issue 12676017: Adding policy support to the new network configuration stack. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove policy initialized flags and wrap PolicyMaps with scoped_ptr. Created 7 years, 8 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
Index: chromeos/dbus/shill_manager_client.cc
diff --git a/chromeos/dbus/shill_manager_client.cc b/chromeos/dbus/shill_manager_client.cc
index 1be4bf22b04a1801d286489a89bb41974afb0ec4..463399594efaf81e036d9f93de208f0215c4503e 100644
--- a/chromeos/dbus/shill_manager_client.cc
+++ b/chromeos/dbus/shill_manager_client.cc
@@ -22,6 +22,17 @@ namespace chromeos {
namespace {
// Returns whether the properties have the required keys or not.
+bool AreServicePropertiesValid2(const base::DictionaryValue& properties) {
stevenjb 2013/04/11 18:20:08 2 is a poor differentiator. Maybe ForProfile or Wi
pneubeck (no reviews) 2013/04/15 12:16:24 Done.
+ if (properties.HasKey(flimflam::kGuidProperty))
+ return true;
+ return properties.HasKey(flimflam::kTypeProperty) &&
+ properties.HasKey(flimflam::kSecurityProperty) &&
+ properties.HasKey(flimflam::kModeProperty) &&
+ properties.HasKey(flimflam::kSSIDProperty);
+}
+
+// DEPRECATED: Keep this only for backward compatibility with NetworkLibrary.
pastarmovj 2013/04/11 14:46:29 Put a todo here to remove that once not needed and
pneubeck (no reviews) 2013/04/15 12:16:24 Done.
+// Returns whether the properties have the required keys or not.
bool AreServicePropertiesValid(const base::DictionaryValue& properties) {
if (properties.HasKey(flimflam::kGuidProperty))
return true;
@@ -156,6 +167,22 @@ class ShillManagerClientImpl : public ShillManagerClient {
error_callback);
}
+ virtual void ConfigureServiceForProfile(
+ const dbus::ObjectPath& profile_path,
+ const base::DictionaryValue& properties,
+ const ObjectPathCallback& callback,
+ const ErrorCallback& error_callback) OVERRIDE {
+ DCHECK(AreServicePropertiesValid2(properties));
pastarmovj 2013/04/11 14:46:29 DCHECK will only verify in debug builds - does you
pneubeck (no reviews) 2013/04/15 12:16:24 Done.
+ dbus::MethodCall method_call(flimflam::kFlimflamManagerInterface,
+ shill::kConfigureServiceForProfileFunction);
+ dbus::MessageWriter writer(&method_call);
+ writer.AppendObjectPath(dbus::ObjectPath(profile_path));
+ AppendServicePropertiesDictionary(&writer, properties);
+ helper_.CallObjectPathMethodWithErrorCallback(&method_call,
+ callback,
+ error_callback);
+ }
+
virtual void GetService(
const base::DictionaryValue& properties,
const ObjectPathCallback& callback,

Powered by Google App Engine
This is Rietveld 408576698