| 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/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 return DBusThreadManager::Get()->GetShillManagerClient()->GetTestInterface()-> | 48 return DBusThreadManager::Get()->GetShillManagerClient()->GetTestInterface()-> |
| 49 GetInteractiveDelay(); | 49 GetInteractiveDelay(); |
| 50 } | 50 } |
| 51 | 51 |
| 52 } // namespace | 52 } // namespace |
| 53 | 53 |
| 54 FakeShillServiceClient::FakeShillServiceClient() : weak_ptr_factory_(this) { | 54 FakeShillServiceClient::FakeShillServiceClient() : weak_ptr_factory_(this) { |
| 55 } | 55 } |
| 56 | 56 |
| 57 FakeShillServiceClient::~FakeShillServiceClient() { | 57 FakeShillServiceClient::~FakeShillServiceClient() { |
| 58 STLDeleteContainerPairSecondPointers( | 58 base::STLDeleteContainerPairSecondPointers(observer_list_.begin(), |
| 59 observer_list_.begin(), observer_list_.end()); | 59 observer_list_.end()); |
| 60 } | 60 } |
| 61 | 61 |
| 62 | 62 |
| 63 // ShillServiceClient overrides. | 63 // ShillServiceClient overrides. |
| 64 | 64 |
| 65 void FakeShillServiceClient::Init(dbus::Bus* bus) { | 65 void FakeShillServiceClient::Init(dbus::Bus* bus) { |
| 66 } | 66 } |
| 67 | 67 |
| 68 void FakeShillServiceClient::AddPropertyChangedObserver( | 68 void FakeShillServiceClient::AddPropertyChangedObserver( |
| 69 const dbus::ObjectPath& service_path, | 69 const dbus::ObjectPath& service_path, |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 } | 597 } |
| 598 | 598 |
| 599 void FakeShillServiceClient::ContinueConnect(const std::string& service_path) { | 599 void FakeShillServiceClient::ContinueConnect(const std::string& service_path) { |
| 600 VLOG(1) << "FakeShillServiceClient::ContinueConnect: " << service_path; | 600 VLOG(1) << "FakeShillServiceClient::ContinueConnect: " << service_path; |
| 601 base::DictionaryValue* service_properties = NULL; | 601 base::DictionaryValue* service_properties = NULL; |
| 602 if (!stub_services_.GetDictionary(service_path, &service_properties)) { | 602 if (!stub_services_.GetDictionary(service_path, &service_properties)) { |
| 603 LOG(ERROR) << "Service not found: " << service_path; | 603 LOG(ERROR) << "Service not found: " << service_path; |
| 604 return; | 604 return; |
| 605 } | 605 } |
| 606 | 606 |
| 607 if (ContainsKey(connect_behavior_, service_path)) { | 607 if (base::ContainsKey(connect_behavior_, service_path)) { |
| 608 const base::Closure& custom_connect_behavior = | 608 const base::Closure& custom_connect_behavior = |
| 609 connect_behavior_[service_path]; | 609 connect_behavior_[service_path]; |
| 610 VLOG(1) << "Running custom connect behavior for " << service_path; | 610 VLOG(1) << "Running custom connect behavior for " << service_path; |
| 611 custom_connect_behavior.Run(); | 611 custom_connect_behavior.Run(); |
| 612 return; | 612 return; |
| 613 } | 613 } |
| 614 | 614 |
| 615 // No custom connect behavior set, continue with the default connect behavior. | 615 // No custom connect behavior set, continue with the default connect behavior. |
| 616 std::string passphrase; | 616 std::string passphrase; |
| 617 service_properties->GetStringWithoutPathExpansion(shill::kPassphraseProperty, | 617 service_properties->GetStringWithoutPathExpansion(shill::kPassphraseProperty, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 630 base::StringValue(shill::kErrorBadPassphrase))); | 630 base::StringValue(shill::kErrorBadPassphrase))); |
| 631 } else { | 631 } else { |
| 632 // Set Online. | 632 // Set Online. |
| 633 VLOG(1) << "Setting state to Online " << service_path; | 633 VLOG(1) << "Setting state to Online " << service_path; |
| 634 SetServiceProperty(service_path, shill::kStateProperty, | 634 SetServiceProperty(service_path, shill::kStateProperty, |
| 635 base::StringValue(shill::kStateOnline)); | 635 base::StringValue(shill::kStateOnline)); |
| 636 } | 636 } |
| 637 } | 637 } |
| 638 | 638 |
| 639 } // namespace chromeos | 639 } // namespace chromeos |
| OLD | NEW |