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

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

Issue 148293003: Refactor to support default Bluetooth pairing delegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: wat Created 6 years, 10 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 | « no previous file | device/bluetooth/bluetooth_adapter_chromeos.h » ('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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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_bluetooth_agent_manager_client.h" 5 #include "chromeos/dbus/fake_bluetooth_agent_manager_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "chromeos/dbus/fake_bluetooth_agent_service_provider.h" 9 #include "chromeos/dbus/fake_bluetooth_agent_service_provider.h"
10 #include "dbus/object_path.h" 10 #include "dbus/object_path.h"
(...skipping 27 matching lines...) Expand all
38 } else { 38 } else {
39 callback.Run(); 39 callback.Run();
40 } 40 }
41 } 41 }
42 42
43 void FakeBluetoothAgentManagerClient::UnregisterAgent( 43 void FakeBluetoothAgentManagerClient::UnregisterAgent(
44 const dbus::ObjectPath& agent_path, 44 const dbus::ObjectPath& agent_path,
45 const base::Closure& callback, 45 const base::Closure& callback,
46 const ErrorCallback& error_callback) { 46 const ErrorCallback& error_callback) {
47 VLOG(1) << "UnregisterAgent: " << agent_path.value(); 47 VLOG(1) << "UnregisterAgent: " << agent_path.value();
48 if (service_provider_ != NULL) { 48 if (service_provider_ == NULL) {
49 error_callback.Run(bluetooth_agent_manager::kErrorInvalidArguments, 49 error_callback.Run(bluetooth_agent_manager::kErrorDoesNotExist,
50 "No agent registered");
51 } else if (service_provider_->object_path_ != agent_path) {
52 error_callback.Run(bluetooth_agent_manager::kErrorDoesNotExist,
50 "Agent still registered"); 53 "Agent still registered");
51 } else { 54 } else {
52 callback.Run(); 55 callback.Run();
53 } 56 }
54 } 57 }
55 58
56 void FakeBluetoothAgentManagerClient::RequestDefaultAgent( 59 void FakeBluetoothAgentManagerClient::RequestDefaultAgent(
57 const dbus::ObjectPath& agent_path, 60 const dbus::ObjectPath& agent_path,
58 const base::Closure& callback, 61 const base::Closure& callback,
59 const ErrorCallback& error_callback) { 62 const ErrorCallback& error_callback) {
(...skipping 11 matching lines...) Expand all
71 if (service_provider_ == service_provider) 74 if (service_provider_ == service_provider)
72 service_provider_ = NULL; 75 service_provider_ = NULL;
73 } 76 }
74 77
75 FakeBluetoothAgentServiceProvider* 78 FakeBluetoothAgentServiceProvider*
76 FakeBluetoothAgentManagerClient::GetAgentServiceProvider() { 79 FakeBluetoothAgentManagerClient::GetAgentServiceProvider() {
77 return service_provider_; 80 return service_provider_;
78 } 81 }
79 82
80 } // namespace chromeos 83 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | device/bluetooth/bluetooth_adapter_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698