| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chromeos/network/shill_property_handler.h" | 5 #include "chromeos/network/shill_property_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 } | 154 } |
| 155 if (notify) | 155 if (notify) |
| 156 listener_->ManagerPropertyChanged(); | 156 listener_->ManagerPropertyChanged(); |
| 157 } | 157 } |
| 158 | 158 |
| 159 bool ShillPropertyHandler::ManagerPropertyChanged(const std::string& key, | 159 bool ShillPropertyHandler::ManagerPropertyChanged(const std::string& key, |
| 160 const base::Value& value) { | 160 const base::Value& value) { |
| 161 bool notify_manager_changed = false; | 161 bool notify_manager_changed = false; |
| 162 if (key == flimflam::kServicesProperty) { | 162 if (key == flimflam::kServicesProperty) { |
| 163 const base::ListValue* vlist = GetListValue(key, value); | 163 const base::ListValue* vlist = GetListValue(key, value); |
| 164 if (vlist) | 164 if (vlist) { |
| 165 UpdateManagedList(ManagedState::MANAGED_TYPE_NETWORK, *vlist); | 165 UpdateManagedList(ManagedState::MANAGED_TYPE_NETWORK, *vlist); |
| 166 } else if (key == flimflam::kServiceWatchListProperty) { | 166 // TODO(stevenjb): Use kServiceWatchListProperty and request properties |
| 167 const base::ListValue* vlist = GetListValue(key, value); | 167 // for new entries. |
| 168 if (vlist) { | |
| 169 UpdateObservedNetworkServices(*vlist); | 168 UpdateObservedNetworkServices(*vlist); |
| 170 } | 169 } |
| 171 } else if (key == flimflam::kDevicesProperty) { | 170 } else if (key == flimflam::kDevicesProperty) { |
| 172 const ListValue* vlist = GetListValue(key, value); | 171 const ListValue* vlist = GetListValue(key, value); |
| 173 if (vlist) | 172 if (vlist) |
| 174 UpdateManagedList(ManagedState::MANAGED_TYPE_DEVICE, *vlist); | 173 UpdateManagedList(ManagedState::MANAGED_TYPE_DEVICE, *vlist); |
| 175 } else if (key == flimflam::kAvailableTechnologiesProperty) { | 174 } else if (key == flimflam::kAvailableTechnologiesProperty) { |
| 176 const base::ListValue* vlist = GetListValue(key, value); | 175 const base::ListValue* vlist = GetListValue(key, value); |
| 177 if (vlist) { | 176 if (vlist) { |
| 178 listener_->UpdateAvailableTechnologies(*vlist); | 177 listener_->UpdateAvailableTechnologies(*vlist); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 if (!properties.GetStringWithoutPathExpansion(flimflam::kAddressProperty, | 275 if (!properties.GetStringWithoutPathExpansion(flimflam::kAddressProperty, |
| 277 &ip_address)) { | 276 &ip_address)) { |
| 278 LOG(ERROR) << "Failed to get IP Address property for: " << service_path; | 277 LOG(ERROR) << "Failed to get IP Address property for: " << service_path; |
| 279 return; | 278 return; |
| 280 } | 279 } |
| 281 listener_->UpdateNetworkServiceIPAddress(service_path, ip_address); | 280 listener_->UpdateNetworkServiceIPAddress(service_path, ip_address); |
| 282 } | 281 } |
| 283 | 282 |
| 284 } // namespace internal | 283 } // namespace internal |
| 285 } // namespace chromeos | 284 } // namespace chromeos |
| OLD | NEW |