| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 enabled_technologies_.erase(technology); | 155 enabled_technologies_.erase(technology); |
| 156 enabling_technologies_.erase(technology); | 156 enabling_technologies_.erase(technology); |
| 157 shill_manager_->DisableTechnology( | 157 shill_manager_->DisableTechnology( |
| 158 technology, | 158 technology, |
| 159 base::Bind(&base::DoNothing), | 159 base::Bind(&base::DoNothing), |
| 160 base::Bind(&network_handler::ShillErrorCallbackFunction, | 160 base::Bind(&network_handler::ShillErrorCallbackFunction, |
| 161 technology, error_callback)); | 161 technology, error_callback)); |
| 162 } | 162 } |
| 163 } | 163 } |
| 164 | 164 |
| 165 void ShillPropertyHandler::SetCheckPortalList( |
| 166 const std::string& check_portal_list) { |
| 167 base::StringValue value(check_portal_list); |
| 168 shill_manager_->SetProperty( |
| 169 flimflam::kCheckPortalListProperty, |
| 170 value, |
| 171 base::Bind(&base::DoNothing), |
| 172 base::Bind(&network_handler::ShillErrorCallbackFunction, |
| 173 "", network_handler::ErrorCallback())); |
| 174 } |
| 175 |
| 165 void ShillPropertyHandler::RequestScan() const { | 176 void ShillPropertyHandler::RequestScan() const { |
| 166 shill_manager_->RequestScan( | 177 shill_manager_->RequestScan( |
| 167 "", | 178 "", |
| 168 base::Bind(&base::DoNothing), | 179 base::Bind(&base::DoNothing), |
| 169 base::Bind(&network_handler::ShillErrorCallbackFunction, | 180 base::Bind(&network_handler::ShillErrorCallbackFunction, |
| 170 "", network_handler::ErrorCallback())); | 181 "", network_handler::ErrorCallback())); |
| 171 } | 182 } |
| 172 | 183 |
| 173 void ShillPropertyHandler::ConnectToBestServices() const { | 184 void ShillPropertyHandler::ConnectToBestServices() const { |
| 174 NET_LOG_EVENT("ConnectToBestServices", ""); | 185 NET_LOG_EVENT("ConnectToBestServices", ""); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 notify_manager_changed = true; | 300 notify_manager_changed = true; |
| 290 } | 301 } |
| 291 } else if (key == shill::kUninitializedTechnologiesProperty) { | 302 } else if (key == shill::kUninitializedTechnologiesProperty) { |
| 292 const base::ListValue* vlist = GetListValue(key, value); | 303 const base::ListValue* vlist = GetListValue(key, value); |
| 293 if (vlist) { | 304 if (vlist) { |
| 294 UpdateUninitializedTechnologies(*vlist); | 305 UpdateUninitializedTechnologies(*vlist); |
| 295 notify_manager_changed = true; | 306 notify_manager_changed = true; |
| 296 } | 307 } |
| 297 } else if (key == flimflam::kProfilesProperty) { | 308 } else if (key == flimflam::kProfilesProperty) { |
| 298 listener_->ProfileListChanged(); | 309 listener_->ProfileListChanged(); |
| 310 } else if (key == flimflam::kCheckPortalListProperty) { |
| 311 std::string check_portal_list; |
| 312 if (value.GetAsString(&check_portal_list)) { |
| 313 listener_->CheckPortalListChanged(check_portal_list); |
| 314 notify_manager_changed = true; |
| 315 } |
| 299 } | 316 } |
| 300 return notify_manager_changed; | 317 return notify_manager_changed; |
| 301 } | 318 } |
| 302 | 319 |
| 303 void ShillPropertyHandler::UpdateObserved(ManagedState::ManagedType type, | 320 void ShillPropertyHandler::UpdateObserved(ManagedState::ManagedType type, |
| 304 const base::ListValue& entries) { | 321 const base::ListValue& entries) { |
| 305 ShillPropertyObserverMap& observer_map = | 322 ShillPropertyObserverMap& observer_map = |
| 306 (type == ManagedState::MANAGED_TYPE_NETWORK) | 323 (type == ManagedState::MANAGED_TYPE_NETWORK) |
| 307 ? observed_networks_ : observed_devices_; | 324 ? observed_networks_ : observed_devices_; |
| 308 ShillPropertyObserverMap new_observed; | 325 ShillPropertyObserverMap new_observed; |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 | 504 |
| 488 void ShillPropertyHandler::NetworkDevicePropertyChangedCallback( | 505 void ShillPropertyHandler::NetworkDevicePropertyChangedCallback( |
| 489 const std::string& path, | 506 const std::string& path, |
| 490 const std::string& key, | 507 const std::string& key, |
| 491 const base::Value& value) { | 508 const base::Value& value) { |
| 492 listener_->UpdateDeviceProperty(path, key, value); | 509 listener_->UpdateDeviceProperty(path, key, value); |
| 493 } | 510 } |
| 494 | 511 |
| 495 } // namespace internal | 512 } // namespace internal |
| 496 } // namespace chromeos | 513 } // namespace chromeos |
| OLD | NEW |