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

Unified Diff: chromeos/network/network_configuration_handler.cc

Issue 708563005: Use setProperties for IP Config. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_430113_internet_options_1
Patch Set: Fix win/mac test expectations Created 5 years, 11 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 1ad09d80d046c05d4a67930f1b46324ac74da084..841398c3a252d802709815278fa8eca57d3e5f70 100644
--- a/chromeos/network/network_configuration_handler.cc
+++ b/chromeos/network/network_configuration_handler.cc
@@ -20,6 +20,7 @@
#include "chromeos/dbus/shill_manager_client.h"
#include "chromeos/dbus/shill_profile_client.h"
#include "chromeos/dbus/shill_service_client.h"
+#include "chromeos/network/network_device_handler.h"
#include "chromeos/network/network_event_log.h"
#include "chromeos/network/network_state.h"
#include "chromeos/network/network_state_handler.h"
@@ -258,6 +259,11 @@ void NetworkConfigurationHandler::SetProperties(
source, callback),
base::Bind(&NetworkConfigurationHandler::SetPropertiesErrorCallback,
AsWeakPtr(), service_path, error_callback));
+
+ // If we set the StaticIPConfig property, request an IP config refresh
+ // after calling SetProperties.
+ if (properties.HasKey(shill::kStaticIPConfigProperty))
+ RequestRefreshIPConfigs(service_path);
}
void NetworkConfigurationHandler::ClearProperties(
@@ -374,8 +380,10 @@ NetworkConfigurationHandler::~NetworkConfigurationHandler() {
}
void NetworkConfigurationHandler::Init(
- NetworkStateHandler* network_state_handler) {
+ NetworkStateHandler* network_state_handler,
+ NetworkDeviceHandler* network_device_handler) {
network_state_handler_ = network_state_handler;
+ network_device_handler_ = network_device_handler;
}
void NetworkConfigurationHandler::RunCreateNetworkCallback(
@@ -492,11 +500,25 @@ void NetworkConfigurationHandler::ClearPropertiesErrorCallback(
network_state_handler_->RequestUpdateForNetwork(service_path);
}
+void NetworkConfigurationHandler::RequestRefreshIPConfigs(
+ const std::string& service_path) {
+ if (!network_device_handler_)
+ return;
+ const NetworkState* network_state =
+ network_state_handler_->GetNetworkState(service_path);
+ if (!network_state || network_state->device_path().empty())
+ return;
+ network_device_handler_->RequestRefreshIPConfigs(
+ network_state->device_path(), base::Bind(&base::DoNothing),
+ network_handler::ErrorCallback());
+}
+
// static
NetworkConfigurationHandler* NetworkConfigurationHandler::InitializeForTest(
- NetworkStateHandler* network_state_handler) {
+ NetworkStateHandler* network_state_handler,
+ NetworkDeviceHandler* network_device_handler) {
NetworkConfigurationHandler* handler = new NetworkConfigurationHandler();
- handler->Init(network_state_handler);
+ handler->Init(network_state_handler, network_device_handler);
return handler;
}
« no previous file with comments | « chromeos/network/network_configuration_handler.h ('k') | chromeos/network/network_configuration_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698