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

Side by Side Diff: device/bluetooth/bluetooth_adapter.cc

Issue 1057603004: bluetooth: Refactor (Add|Remove)Observer impls into BluetoothAdapter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bta-style-guide-ordering-
Patch Set: Merge TOT Created 5 years, 8 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 | « device/bluetooth/bluetooth_adapter.h ('k') | 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) 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 "device/bluetooth/bluetooth_adapter.h" 5 #include "device/bluetooth/bluetooth_adapter.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "device/bluetooth/bluetooth_device.h" 9 #include "device/bluetooth/bluetooth_device.h"
10 #include "device/bluetooth/bluetooth_discovery_session.h" 10 #include "device/bluetooth/bluetooth_discovery_session.h"
(...skipping 16 matching lines...) Expand all
27 base::WeakPtr<BluetoothAdapter> BluetoothAdapter::GetWeakPtrForTesting() { 27 base::WeakPtr<BluetoothAdapter> BluetoothAdapter::GetWeakPtrForTesting() {
28 return weak_ptr_factory_.GetWeakPtr(); 28 return weak_ptr_factory_.GetWeakPtr();
29 } 29 }
30 30
31 #if defined(OS_CHROMEOS) 31 #if defined(OS_CHROMEOS)
32 void BluetoothAdapter::Shutdown() { 32 void BluetoothAdapter::Shutdown() {
33 NOTIMPLEMENTED(); 33 NOTIMPLEMENTED();
34 } 34 }
35 #endif 35 #endif
36 36
37 void BluetoothAdapter::AddObserver(BluetoothAdapter::Observer* observer) {
38 DCHECK(observer);
39 observers_.AddObserver(observer);
40 }
41
42 void BluetoothAdapter::RemoveObserver(BluetoothAdapter::Observer* observer) {
43 DCHECK(observer);
44 observers_.RemoveObserver(observer);
45 }
46
37 void BluetoothAdapter::StartDiscoverySession( 47 void BluetoothAdapter::StartDiscoverySession(
38 const DiscoverySessionCallback& callback, 48 const DiscoverySessionCallback& callback,
39 const ErrorCallback& error_callback) { 49 const ErrorCallback& error_callback) {
40 StartDiscoverySessionWithFilter(nullptr, callback, error_callback); 50 StartDiscoverySessionWithFilter(nullptr, callback, error_callback);
41 } 51 }
42 52
43 void BluetoothAdapter::StartDiscoverySessionWithFilter( 53 void BluetoothAdapter::StartDiscoverySessionWithFilter(
44 scoped_ptr<BluetoothDiscoveryFilter> discovery_filter, 54 scoped_ptr<BluetoothDiscoveryFilter> discovery_filter,
45 const DiscoverySessionCallback& callback, 55 const DiscoverySessionCallback& callback,
46 const ErrorCallback& error_callback) { 56 const ErrorCallback& error_callback) {
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 continue; 216 continue;
207 } 217 }
208 218
209 result = BluetoothDiscoveryFilter::Merge(result.get(), curr_filter); 219 result = BluetoothDiscoveryFilter::Merge(result.get(), curr_filter);
210 } 220 }
211 221
212 return result.Pass(); 222 return result.Pass();
213 } 223 }
214 224
215 } // namespace device 225 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_adapter.h ('k') | device/bluetooth/bluetooth_adapter_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698