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

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

Issue 2384463002: bluetooth: mac: Reject requestDevice promise if Mac version is <= 10.9 (Closed)
Patch Set: Created 4 years, 2 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_factory_wrapper.h" 5 #include "device/bluetooth/bluetooth_adapter_factory_wrapper.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 22 matching lines...) Expand all
33 // static 33 // static
34 BluetoothAdapterFactoryWrapper& BluetoothAdapterFactoryWrapper::Get() { 34 BluetoothAdapterFactoryWrapper& BluetoothAdapterFactoryWrapper::Get() {
35 return g_singleton.Get(); 35 return g_singleton.Get();
36 } 36 }
37 37
38 bool BluetoothAdapterFactoryWrapper::IsBluetoothAdapterAvailable() { 38 bool BluetoothAdapterFactoryWrapper::IsBluetoothAdapterAvailable() {
39 DCHECK(thread_checker_.CalledOnValidThread()); 39 DCHECK(thread_checker_.CalledOnValidThread());
40 return BluetoothAdapterFactory::IsBluetoothAdapterAvailable(); 40 return BluetoothAdapterFactory::IsBluetoothAdapterAvailable();
41 } 41 }
42 42
43 bool BluetoothAdapterFactoryWrapper::IsLowEnergyAvailable() {
44 DCHECK(thread_checker_.CalledOnValidThread());
45 return BluetoothAdapterFactory::IsLowEnergyAvailable();
ortuno 2016/10/04 03:20:24 I think you would want a similar logic to the adap
François Beaufort 2016/10/04 10:00:22 Done.
46 }
47
43 void BluetoothAdapterFactoryWrapper::AcquireAdapter( 48 void BluetoothAdapterFactoryWrapper::AcquireAdapter(
44 BluetoothAdapter::Observer* observer, 49 BluetoothAdapter::Observer* observer,
45 const AcquireAdapterCallback& callback) { 50 const AcquireAdapterCallback& callback) {
46 DCHECK(thread_checker_.CalledOnValidThread()); 51 DCHECK(thread_checker_.CalledOnValidThread());
47 DCHECK(!GetAdapter(observer)); 52 DCHECK(!GetAdapter(observer));
48 53
49 AddAdapterObserver(observer); 54 AddAdapterObserver(observer);
50 if (adapter_.get()) { 55 if (adapter_.get()) {
51 base::ThreadTaskRunnerHandle::Get()->PostTask( 56 base::ThreadTaskRunnerHandle::Get()->PostTask(
52 FROM_HERE, base::Bind(callback, base::Unretained(adapter_.get()))); 57 FROM_HERE, base::Bind(callback, base::Unretained(adapter_.get())));
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 } 144 }
140 adapter_ = adapter; 145 adapter_ = adapter;
141 if (adapter_.get()) { 146 if (adapter_.get()) {
142 for (BluetoothAdapter::Observer* observer : adapter_observers_) { 147 for (BluetoothAdapter::Observer* observer : adapter_observers_) {
143 adapter_->AddObserver(observer); 148 adapter_->AddObserver(observer);
144 } 149 }
145 } 150 }
146 } 151 }
147 152
148 } // namespace device 153 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698