Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1898)

Side by Side Diff: chromeos/dbus/fake_shill_service_client.cc

Issue 2229383003: chromeos: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chromeos/dbus/fake_shill_profile_client.cc ('k') | chromeos/dbus/nfc_client_helpers.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « chromeos/dbus/fake_shill_profile_client.cc ('k') | chromeos/dbus/nfc_client_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698