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

Unified Diff: chromeos/network/network_configuration_handler.cc

Issue 12676017: Adding policy support to the new network configuration stack. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Julian's comments. Reuploaded with rebase. 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/network/network_configuration_handler.cc
diff --git a/chromeos/network/network_configuration_handler.cc b/chromeos/network/network_configuration_handler.cc
index 17c691fe0969784ea274a9e8a8e585dc6b5c0517..ee950d3cf327e890cbdf930275ca0c2be2cad74d 100644
--- a/chromeos/network/network_configuration_handler.cc
+++ b/chromeos/network/network_configuration_handler.cc
@@ -17,6 +17,7 @@
#include "chromeos/dbus/shill_manager_client.h"
#include "chromeos/dbus/shill_service_client.h"
#include "dbus/object_path.h"
+#include "third_party/cros_system_api/dbus/service_constants.h"
namespace chromeos {
@@ -193,11 +194,32 @@ void NetworkConfigurationHandler::CreateConfiguration(
const base::DictionaryValue& properties,
const network_handler::StringResultCallback& callback,
const network_handler::ErrorCallback& error_callback) const {
- DBusThreadManager::Get()->GetShillManagerClient()->GetService(
- properties,
- base::Bind(&RunCreateNetworkCallback, callback),
- base::Bind(&network_handler::ShillErrorCallbackFunction,
- kLogModule, "", error_callback));
+ ShillManagerClient* manager =
+ DBusThreadManager::Get()->GetShillManagerClient();
+
+ std::string type;
+ properties.GetStringWithoutPathExpansion(flimflam::kTypeProperty, &type);
+ // Shill supports ConfigureServiceForProfile only for network type WiFi. In
+ // all other cases, we have to rely on GetService for now. This is
+ // unproblematic for VPN (user profile only), but will lead to inconsistencies
+ // with WiMax, for example.
+ if (type == flimflam::kTypeWifi) {
+ std::string profile;
+ properties.GetStringWithoutPathExpansion(flimflam::kProfileProperty,
+ &profile);
+ manager->ConfigureServiceForProfile(
+ dbus::ObjectPath(profile),
+ properties,
+ base::Bind(&RunCreateNetworkCallback, callback),
+ base::Bind(&network_handler::ShillErrorCallbackFunction,
+ kLogModule, "", error_callback));
+ } else {
+ manager->GetService(
+ properties,
+ base::Bind(&RunCreateNetworkCallback, callback),
+ base::Bind(&network_handler::ShillErrorCallbackFunction,
+ kLogModule, "", error_callback));
+ }
}
void NetworkConfigurationHandler::RemoveConfiguration(

Powered by Google App Engine
This is Rietveld 408576698