| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/dbus/fake_shill_service_client.h" | 5 #include "chromeos/dbus/fake_shill_service_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 if (!stub_services_.GetDictionaryWithoutPathExpansion(path, &dict)) { | 514 if (!stub_services_.GetDictionaryWithoutPathExpansion(path, &dict)) { |
| 515 LOG(ERROR) << "Notify for unknown service: " << path; | 515 LOG(ERROR) << "Notify for unknown service: " << path; |
| 516 return; | 516 return; |
| 517 } | 517 } |
| 518 base::Value* value = NULL; | 518 base::Value* value = NULL; |
| 519 if (!dict->GetWithoutPathExpansion(property, &value)) { | 519 if (!dict->GetWithoutPathExpansion(property, &value)) { |
| 520 LOG(ERROR) << "Notify for unknown property: " | 520 LOG(ERROR) << "Notify for unknown property: " |
| 521 << path << " : " << property; | 521 << path << " : " << property; |
| 522 return; | 522 return; |
| 523 } | 523 } |
| 524 FOR_EACH_OBSERVER(ShillPropertyChangedObserver, | 524 for (auto& observer : GetObserverList(service_path)) |
| 525 GetObserverList(service_path), | 525 observer.OnPropertyChanged(property, *value); |
| 526 OnPropertyChanged(property, *value)); | |
| 527 } | 526 } |
| 528 | 527 |
| 529 base::DictionaryValue* FakeShillServiceClient::GetModifiableServiceProperties( | 528 base::DictionaryValue* FakeShillServiceClient::GetModifiableServiceProperties( |
| 530 const std::string& service_path, bool create_if_missing) { | 529 const std::string& service_path, bool create_if_missing) { |
| 531 base::DictionaryValue* properties = NULL; | 530 base::DictionaryValue* properties = NULL; |
| 532 if (!stub_services_.GetDictionaryWithoutPathExpansion(service_path, | 531 if (!stub_services_.GetDictionaryWithoutPathExpansion(service_path, |
| 533 &properties) && | 532 &properties) && |
| 534 create_if_missing) { | 533 create_if_missing) { |
| 535 properties = new base::DictionaryValue; | 534 properties = new base::DictionaryValue; |
| 536 stub_services_.Set(service_path, properties); | 535 stub_services_.Set(service_path, properties); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 base::StringValue(shill::kErrorBadPassphrase))); | 626 base::StringValue(shill::kErrorBadPassphrase))); |
| 628 } else { | 627 } else { |
| 629 // Set Online. | 628 // Set Online. |
| 630 VLOG(1) << "Setting state to Online " << service_path; | 629 VLOG(1) << "Setting state to Online " << service_path; |
| 631 SetServiceProperty(service_path, shill::kStateProperty, | 630 SetServiceProperty(service_path, shill::kStateProperty, |
| 632 base::StringValue(shill::kStateOnline)); | 631 base::StringValue(shill::kStateOnline)); |
| 633 } | 632 } |
| 634 } | 633 } |
| 635 | 634 |
| 636 } // namespace chromeos | 635 } // namespace chromeos |
| OLD | NEW |