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

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

Issue 1130783004: bluetooth: Enable BluetoothAdapterFactory on android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bta-ut-permission-
Patch Set: Created 5 years, 7 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 (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_factory.h" 5 #include "device/bluetooth/bluetooth_adapter_factory.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 #endif // defined(OS_WIN) 55 #endif // defined(OS_WIN)
56 56
57 } // namespace 57 } // namespace
58 58
59 // static 59 // static
60 bool BluetoothAdapterFactory::IsBluetoothAdapterAvailable() { 60 bool BluetoothAdapterFactory::IsBluetoothAdapterAvailable() {
61 // SetAdapterForTesting() may be used to provide a test or mock adapter 61 // SetAdapterForTesting() may be used to provide a test or mock adapter
62 // instance even on platforms that would otherwise not support it. 62 // instance even on platforms that would otherwise not support it.
63 if (default_adapter.Get()) 63 if (default_adapter.Get())
64 return true; 64 return true;
65 #if defined(OS_CHROMEOS) || defined(OS_WIN) 65 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) || defined(OS_WIN)
66 return true; 66 return true;
67 #elif defined(OS_MACOSX) 67 #elif defined(OS_MACOSX)
68 return base::mac::IsOSLionOrLater(); 68 return base::mac::IsOSLionOrLater();
69 #else 69 #else
70 return false; 70 return false;
71 #endif 71 #endif
72 } 72 }
73 73
74 // static 74 // static
75 void BluetoothAdapterFactory::GetAdapter(const AdapterCallback& callback) { 75 void BluetoothAdapterFactory::GetAdapter(const AdapterCallback& callback) {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 scoped_refptr<BluetoothAdapter> adapter) { 111 scoped_refptr<BluetoothAdapter> adapter) {
112 default_adapter.Get() = adapter->GetWeakPtrForTesting(); 112 default_adapter.Get() = adapter->GetWeakPtrForTesting();
113 } 113 }
114 114
115 // static 115 // static
116 bool BluetoothAdapterFactory::HasSharedInstanceForTesting() { 116 bool BluetoothAdapterFactory::HasSharedInstanceForTesting() {
117 return default_adapter.Get(); 117 return default_adapter.Get();
118 } 118 }
119 119
120 } // namespace device 120 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698