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, |