Chromium Code Reviews| Index: chromeos/network/device_state.cc |
| diff --git a/chromeos/network/device_state.cc b/chromeos/network/device_state.cc |
| index 6fd8d7d7d9aa4032186874a485f32c19b94eed3d..a0eade0502ee7add25fd95f1551b0af1a59f62b9 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 { |
| @@ -132,9 +133,27 @@ bool DeviceState::InitialPropertiesReceived( |
| bool locked = !sim_lock_type_.empty(); |
| UMA_HISTOGRAM_BOOLEAN("Cellular.SIMLocked", locked); |
| } |
| + // IP Configs will be added when they are received. |
|
pneubeck (no reviews)
2014/05/05 21:09:28
the comment doesn't explain why you have to clear
stevenjb
2014/05/06 01:15:11
Moved this logic and added a better comment.
|
| + ip_configs_.Clear(); |
| return false; |
| } |
| +void DeviceState::IPConfigPropertiesChanged( |
| + const std::string& ip_config_path, |
| + const base::DictionaryValue& properties) { |
| + base::DictionaryValue* ip_config; |
|
pneubeck (no reviews)
2014/05/05 21:09:28
nit: initialize with NULL
stevenjb
2014/05/06 01:15:11
Done.
|
| + 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_; |