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/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 listener_->ManagedStateListChanged(ManagedState::MANAGED_TYPE_FAVORITE); | 280 listener_->ManagedStateListChanged(ManagedState::MANAGED_TYPE_FAVORITE); |
281 } | 281 } |
282 if ((key.empty() || key == shill::kDevicesProperty) && | 282 if ((key.empty() || key == shill::kDevicesProperty) && |
283 pending_updates_[ManagedState::MANAGED_TYPE_DEVICE].size() == 0) { | 283 pending_updates_[ManagedState::MANAGED_TYPE_DEVICE].size() == 0) { |
284 listener_->ManagedStateListChanged(ManagedState::MANAGED_TYPE_DEVICE); | 284 listener_->ManagedStateListChanged(ManagedState::MANAGED_TYPE_DEVICE); |
285 } | 285 } |
286 } | 286 } |
287 | 287 |
288 void ShillPropertyHandler::ManagerPropertyChanged(const std::string& key, | 288 void ShillPropertyHandler::ManagerPropertyChanged(const std::string& key, |
289 const base::Value& value) { | 289 const base::Value& value) { |
290 if (key == shill::kServicesProperty) { | 290 if (key == shill::kDefaultServiceProperty) { |
| 291 std::string service_path; |
| 292 value.GetAsString(&service_path); |
| 293 listener_->DefaultNetworkServiceChanged(service_path); |
| 294 } else if (key == shill::kServicesProperty) { |
291 const base::ListValue* vlist = GetListValue(key, value); | 295 const base::ListValue* vlist = GetListValue(key, value); |
292 if (vlist) { | 296 if (vlist) { |
293 listener_->UpdateManagedList(ManagedState::MANAGED_TYPE_NETWORK, *vlist); | 297 listener_->UpdateManagedList(ManagedState::MANAGED_TYPE_NETWORK, *vlist); |
294 UpdateProperties(ManagedState::MANAGED_TYPE_NETWORK, *vlist); | 298 UpdateProperties(ManagedState::MANAGED_TYPE_NETWORK, *vlist); |
295 // UpdateObserved used to use kServiceWatchListProperty for TYPE_NETWORK, | 299 // UpdateObserved used to use kServiceWatchListProperty for TYPE_NETWORK, |
296 // however that prevents us from receiving Strength updates from inactive | 300 // however that prevents us from receiving Strength updates from inactive |
297 // networks. The overhead for observing all services is not unreasonable | 301 // networks. The overhead for observing all services is not unreasonable |
298 // (and we limit the max number of observed services to kMaxObserved). | 302 // (and we limit the max number of observed services to kMaxObserved). |
299 UpdateObserved(ManagedState::MANAGED_TYPE_NETWORK, *vlist); | 303 UpdateObserved(ManagedState::MANAGED_TYPE_NETWORK, *vlist); |
300 } | 304 } |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 | 576 |
573 void ShillPropertyHandler::NetworkDevicePropertyChangedCallback( | 577 void ShillPropertyHandler::NetworkDevicePropertyChangedCallback( |
574 const std::string& path, | 578 const std::string& path, |
575 const std::string& key, | 579 const std::string& key, |
576 const base::Value& value) { | 580 const base::Value& value) { |
577 listener_->UpdateDeviceProperty(path, key, value); | 581 listener_->UpdateDeviceProperty(path, key, value); |
578 } | 582 } |
579 | 583 |
580 } // namespace internal | 584 } // namespace internal |
581 } // namespace chromeos | 585 } // namespace chromeos |
OLD | NEW |