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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 NET_LOG_DEBUG("StopObserving", iter->first); | 412 NET_LOG_DEBUG("StopObserving", iter->first); |
413 delete iter->second; | 413 delete iter->second; |
414 } | 414 } |
415 observer_map.swap(new_observed); | 415 observer_map.swap(new_observed); |
416 } | 416 } |
417 | 417 |
418 void ShillPropertyHandler::UpdateAvailableTechnologies( | 418 void ShillPropertyHandler::UpdateAvailableTechnologies( |
419 const base::ListValue& technologies) { | 419 const base::ListValue& technologies) { |
420 available_technologies_.clear(); | 420 available_technologies_.clear(); |
421 NET_LOG_EVENT("AvailableTechnologiesChanged", | 421 NET_LOG_EVENT("AvailableTechnologiesChanged", |
422 base::StringPrintf("Size: %"PRIuS, technologies.GetSize())); | 422 base::StringPrintf("Size: %" PRIuS, technologies.GetSize())); |
423 for (base::ListValue::const_iterator iter = technologies.begin(); | 423 for (base::ListValue::const_iterator iter = technologies.begin(); |
424 iter != technologies.end(); ++iter) { | 424 iter != technologies.end(); ++iter) { |
425 std::string technology; | 425 std::string technology; |
426 (*iter)->GetAsString(&technology); | 426 (*iter)->GetAsString(&technology); |
427 DCHECK(!technology.empty()); | 427 DCHECK(!technology.empty()); |
428 available_technologies_.insert(technology); | 428 available_technologies_.insert(technology); |
429 } | 429 } |
430 } | 430 } |
431 | 431 |
432 void ShillPropertyHandler::UpdateEnabledTechnologies( | 432 void ShillPropertyHandler::UpdateEnabledTechnologies( |
433 const base::ListValue& technologies) { | 433 const base::ListValue& technologies) { |
434 enabled_technologies_.clear(); | 434 enabled_technologies_.clear(); |
435 NET_LOG_EVENT("EnabledTechnologiesChanged", | 435 NET_LOG_EVENT("EnabledTechnologiesChanged", |
436 base::StringPrintf("Size: %"PRIuS, technologies.GetSize())); | 436 base::StringPrintf("Size: %" PRIuS, technologies.GetSize())); |
437 for (base::ListValue::const_iterator iter = technologies.begin(); | 437 for (base::ListValue::const_iterator iter = technologies.begin(); |
438 iter != technologies.end(); ++iter) { | 438 iter != technologies.end(); ++iter) { |
439 std::string technology; | 439 std::string technology; |
440 (*iter)->GetAsString(&technology); | 440 (*iter)->GetAsString(&technology); |
441 DCHECK(!technology.empty()); | 441 DCHECK(!technology.empty()); |
442 enabled_technologies_.insert(technology); | 442 enabled_technologies_.insert(technology); |
443 enabling_technologies_.erase(technology); | 443 enabling_technologies_.erase(technology); |
444 } | 444 } |
445 } | 445 } |
446 | 446 |
447 void ShillPropertyHandler::UpdateUninitializedTechnologies( | 447 void ShillPropertyHandler::UpdateUninitializedTechnologies( |
448 const base::ListValue& technologies) { | 448 const base::ListValue& technologies) { |
449 uninitialized_technologies_.clear(); | 449 uninitialized_technologies_.clear(); |
450 NET_LOG_EVENT("UninitializedTechnologiesChanged", | 450 NET_LOG_EVENT("UninitializedTechnologiesChanged", |
451 base::StringPrintf("Size: %"PRIuS, technologies.GetSize())); | 451 base::StringPrintf("Size: %" PRIuS, technologies.GetSize())); |
452 for (base::ListValue::const_iterator iter = technologies.begin(); | 452 for (base::ListValue::const_iterator iter = technologies.begin(); |
453 iter != technologies.end(); ++iter) { | 453 iter != technologies.end(); ++iter) { |
454 std::string technology; | 454 std::string technology; |
455 (*iter)->GetAsString(&technology); | 455 (*iter)->GetAsString(&technology); |
456 DCHECK(!technology.empty()); | 456 DCHECK(!technology.empty()); |
457 uninitialized_technologies_.insert(technology); | 457 uninitialized_technologies_.insert(technology); |
458 } | 458 } |
459 } | 459 } |
460 | 460 |
461 void ShillPropertyHandler::EnableTechnologyFailed( | 461 void ShillPropertyHandler::EnableTechnologyFailed( |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 | 580 |
581 void ShillPropertyHandler::NetworkDevicePropertyChangedCallback( | 581 void ShillPropertyHandler::NetworkDevicePropertyChangedCallback( |
582 const std::string& path, | 582 const std::string& path, |
583 const std::string& key, | 583 const std::string& key, |
584 const base::Value& value) { | 584 const base::Value& value) { |
585 listener_->UpdateDeviceProperty(path, key, value); | 585 listener_->UpdateDeviceProperty(path, key, value); |
586 } | 586 } |
587 | 587 |
588 } // namespace internal | 588 } // namespace internal |
589 } // namespace chromeos | 589 } // namespace chromeos |
OLD | NEW |