Index: chromeos/network/device_state.cc |
diff --git a/chromeos/network/device_state.cc b/chromeos/network/device_state.cc |
index 6fd8d7d7d9aa4032186874a485f32c19b94eed3d..0880ef7393d64247b8ed3e0b6660cb7064382dab 100644 |
--- a/chromeos/network/device_state.cc |
+++ b/chromeos/network/device_state.cc |
@@ -8,6 +8,7 @@ |
#include "base/metrics/histogram.h" |
#include "base/strings/stringprintf.h" |
#include "base/values.h" |
+#include "chromeos/network/network_event_log.h" |
#include "third_party/cros_system_api/dbus/service_constants.h" |
namespace chromeos { |
@@ -121,6 +122,12 @@ bool DeviceState::PropertyChanged(const std::string& key, |
return GetBooleanValue(key, value, &sim_present_); |
} else if (key == shill::kEapAuthenticationCompletedProperty) { |
return GetBooleanValue(key, value, &eap_authentication_completed_); |
+ } else if (key == shill::kIPConfigsProperty) { |
+ // If kIPConfigsProperty changes, clear any previous ip_configs_. |
+ // ShillPropertyhandler will request the IPConfig objects which will trigger |
+ // calls to IPConfigPropertiesChanged. |
+ ip_configs_.Clear(); |
+ return false; // No actual state change. |
} |
return false; |
} |
@@ -135,6 +142,22 @@ bool DeviceState::InitialPropertiesReceived( |
return false; |
} |
+void DeviceState::IPConfigPropertiesChanged( |
+ const std::string& ip_config_path, |
+ const base::DictionaryValue& properties) { |
+ base::DictionaryValue* ip_config = NULL; |
+ if (ip_configs_.GetDictionaryWithoutPathExpansion( |
+ ip_config_path, &ip_config)) { |
+ NET_LOG_EVENT("IPConfig Updated: " + ip_config_path, path()); |
+ ip_config->Clear(); |
+ } else { |
+ NET_LOG_EVENT("IPConfig Added: " + ip_config_path, path()); |
+ ip_config = new base::DictionaryValue; |
+ ip_configs_.SetWithoutPathExpansion(ip_config_path, ip_config); |
+ } |
+ ip_config->MergeDictionary(&properties); |
+} |
+ |
std::string DeviceState::GetFormattedMacAddress() const { |
if (mac_address_.size() % 2 != 0) |
return mac_address_; |