| 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/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 } | 148 } |
| 149 if (notify) | 149 if (notify) |
| 150 listener_->ManagerPropertyChanged(); | 150 listener_->ManagerPropertyChanged(); |
| 151 } | 151 } |
| 152 | 152 |
| 153 bool ShillPropertyHandler::ManagerPropertyChanged(const std::string& key, | 153 bool ShillPropertyHandler::ManagerPropertyChanged(const std::string& key, |
| 154 const base::Value& value) { | 154 const base::Value& value) { |
| 155 bool notify_manager_changed = false; | 155 bool notify_manager_changed = false; |
| 156 if (key == flimflam::kServicesProperty) { | 156 if (key == flimflam::kServicesProperty) { |
| 157 const base::ListValue* vlist = GetListValue(key, value); | 157 const base::ListValue* vlist = GetListValue(key, value); |
| 158 if (vlist) | 158 if (vlist) { |
| 159 UpdateManagedList(ManagedState::MANAGED_TYPE_NETWORK, *vlist); | 159 UpdateManagedList(ManagedState::MANAGED_TYPE_NETWORK, *vlist); |
| 160 } else if (key == flimflam::kServiceWatchListProperty) { | 160 // TODO(stevenjb): Use kServiceWatchListProperty and request properties |
| 161 const base::ListValue* vlist = GetListValue(key, value); | 161 // for new entries. |
| 162 if (vlist) { | |
| 163 UpdateObservedNetworkServices(*vlist); | 162 UpdateObservedNetworkServices(*vlist); |
| 164 } | 163 } |
| 165 } else if (key == flimflam::kDevicesProperty) { | 164 } else if (key == flimflam::kDevicesProperty) { |
| 166 const ListValue* vlist = GetListValue(key, value); | 165 const ListValue* vlist = GetListValue(key, value); |
| 167 if (vlist) | 166 if (vlist) |
| 168 UpdateManagedList(ManagedState::MANAGED_TYPE_DEVICE, *vlist); | 167 UpdateManagedList(ManagedState::MANAGED_TYPE_DEVICE, *vlist); |
| 169 } else if (key == flimflam::kAvailableTechnologiesProperty) { | 168 } else if (key == flimflam::kAvailableTechnologiesProperty) { |
| 170 const base::ListValue* vlist = GetListValue(key, value); | 169 const base::ListValue* vlist = GetListValue(key, value); |
| 171 if (vlist ) { | 170 if (vlist) { |
| 172 listener_->UpdateAvailableTechnologies(*vlist); | 171 listener_->UpdateAvailableTechnologies(*vlist); |
| 173 notify_manager_changed = true; | 172 notify_manager_changed = true; |
| 174 } | 173 } |
| 175 } else if (key == flimflam::kEnabledTechnologiesProperty) { | 174 } else if (key == flimflam::kEnabledTechnologiesProperty) { |
| 176 const base::ListValue* vlist = GetListValue(key, value); | 175 const base::ListValue* vlist = GetListValue(key, value); |
| 177 if (vlist) { | 176 if (vlist) { |
| 178 listener_->UpdateEnabledTechnologies(*vlist); | 177 listener_->UpdateEnabledTechnologies(*vlist); |
| 179 notify_manager_changed = true; | 178 notify_manager_changed = true; |
| 180 } | 179 } |
| 181 } | 180 } |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 if (!properties.GetStringWithoutPathExpansion(flimflam::kAddressProperty, | 262 if (!properties.GetStringWithoutPathExpansion(flimflam::kAddressProperty, |
| 264 &ip_address)) { | 263 &ip_address)) { |
| 265 LOG(ERROR) << "Failed to get IP Address property for: " << service_path; | 264 LOG(ERROR) << "Failed to get IP Address property for: " << service_path; |
| 266 return; | 265 return; |
| 267 } | 266 } |
| 268 listener_->UpdateNetworkServiceIPAddress(service_path, ip_address); | 267 listener_->UpdateNetworkServiceIPAddress(service_path, ip_address); |
| 269 } | 268 } |
| 270 | 269 |
| 271 } // namespace internal | 270 } // namespace internal |
| 272 } // namespace chromeos | 271 } // namespace chromeos |
| OLD | NEW |