diff options
author | gauravsh@chromium.org <gauravsh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-02 23:24:28 +0000 |
---|---|---|
committer | gauravsh@chromium.org <gauravsh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-02 23:24:28 +0000 |
commit | 362fb225a9ad9e27a4f04b11893c0f0b0fb4865d (patch) | |
tree | 16da62d553439fa2123ce5d41e1cd0ebfe8a3194 /chromeos/network/shill_property_handler.cc | |
parent | 5b2c5f170fd5677a3ad640c390fb24c75873fa3d (diff) | |
download | chromium_src-362fb225a9ad9e27a4f04b11893c0f0b0fb4865d.zip chromium_src-362fb225a9ad9e27a4f04b11893c0f0b0fb4865d.tar.gz chromium_src-362fb225a9ad9e27a4f04b11893c0f0b0fb4865d.tar.bz2 |
NetworkChangeNotifierChromeos: Handle IPConfig property changes on the default network
BUG=164501
TEST=verify that dns refreshes while in connected state result in a dns change.
Review URL: https://chromiumcodereview.appspot.com/12634019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191929 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/network/shill_property_handler.cc')
-rw-r--r-- | chromeos/network/shill_property_handler.cc | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/chromeos/network/shill_property_handler.cc b/chromeos/network/shill_property_handler.cc index 2041139..6749518 100644 --- a/chromeos/network/shill_property_handler.cc +++ b/chromeos/network/shill_property_handler.cc @@ -16,6 +16,7 @@ #include "chromeos/dbus/shill_manager_client.h" #include "chromeos/dbus/shill_service_client.h" #include "chromeos/network/network_event_log.h" +#include "chromeos/network/network_state.h" #include "dbus/object_path.h" #include "third_party/cros_system_api/dbus/service_constants.h" @@ -415,7 +416,7 @@ void ShillPropertyHandler::NetworkServicePropertyChangedCallback( const std::string& key, const base::Value& value) { if (key == shill::kIPConfigProperty) { - // Handle IPConfig here and call listener_->UpdateNetworkServiceIPAddress + // Request the IPConfig for the network and update network properties // when the request completes. std::string ip_config_path; value.GetAsString(&ip_config_path); @@ -434,16 +435,30 @@ void ShillPropertyHandler::GetIPConfigCallback( DBusMethodCallStatus call_status, const base::DictionaryValue& properties) { if (call_status != DBUS_METHOD_CALL_SUCCESS) { - LOG(ERROR) << "Failed to get IP properties for: " << service_path; + LOG(ERROR) << "Failed to get IP Config properties for: " << service_path; return; } - std::string ip_address; - if (!properties.GetStringWithoutPathExpansion(flimflam::kAddressProperty, - &ip_address)) { + const base::Value* ip_address; + if (!properties.GetWithoutPathExpansion(flimflam::kAddressProperty, + &ip_address)) { LOG(ERROR) << "Failed to get IP Address property for: " << service_path; return; } - listener_->UpdateNetworkServiceIPAddress(service_path, ip_address); + listener_->UpdateNetworkServiceProperty( + service_path, + NetworkState::IPConfigProperty(flimflam::kAddressProperty), + *ip_address); + + const base::Value* dns_servers = NULL; + if (!properties.GetWithoutPathExpansion( + flimflam::kNameServersProperty, &dns_servers)) { + LOG(ERROR) << "Failed to get Name servers property for: " << service_path; + return; + } + listener_->UpdateNetworkServiceProperty( + service_path, + NetworkState::IPConfigProperty(flimflam::kNameServersProperty), + *dns_servers); } void ShillPropertyHandler::NetworkDevicePropertyChangedCallback( |