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

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

Issue 748873004: Revert of bluetooth: Make device/bluetooth a shared library component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Created 6 years 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_chromeos.h ('k') | device/bluetooth/bluetooth_adapter_mac.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 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_FACTORY_H_ 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_FACTORY_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_FACTORY_H_ 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_FACTORY_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "device/bluetooth/bluetooth_adapter.h" 10 #include "device/bluetooth/bluetooth_adapter.h"
11 #include "device/bluetooth/bluetooth_export.h"
12 11
13 namespace device { 12 namespace device {
14 13
15 // A factory class for building a Bluetooth adapter on platforms where Bluetooth 14 // A factory class for building a Bluetooth adapter on platforms where Bluetooth
16 // is available. 15 // is available.
17 class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterFactory { 16 class BluetoothAdapterFactory {
18 public: 17 public:
19 typedef base::Callback<void(scoped_refptr<BluetoothAdapter> adapter)> 18 typedef base::Callback<void(scoped_refptr<BluetoothAdapter> adapter)>
20 AdapterCallback; 19 AdapterCallback;
21 20
22 // Returns true if the Bluetooth adapter is available for the current 21 // Returns true if the Bluetooth adapter is available for the current
23 // platform. 22 // platform.
24 static bool IsBluetoothAdapterAvailable(); 23 static bool IsBluetoothAdapterAvailable();
25 24
26 // Returns the shared instance of the default adapter, creating and 25 // Returns the shared instance of the default adapter, creating and
27 // initializing it if necessary. |callback| is called with the adapter 26 // initializing it if necessary. |callback| is called with the adapter
28 // instance passed only once the adapter is fully initialized and ready to 27 // instance passed only once the adapter is fully initialized and ready to
29 // use. 28 // use.
30 static void GetAdapter(const AdapterCallback& callback); 29 static void GetAdapter(const AdapterCallback& callback);
31 30
32 // Sets the shared instance of the default adapter for testing purposes only, 31 // Sets the shared instance of the default adapter for testing purposes only,
33 // no reference is retained after completion of the call, removing the last 32 // no reference is retained after completion of the call, removing the last
34 // reference will reset the factory. 33 // reference will reset the factory.
35 static void SetAdapterForTesting(scoped_refptr<BluetoothAdapter> adapter); 34 static void SetAdapterForTesting(scoped_refptr<BluetoothAdapter> adapter);
36 35
37 // Returns true iff the implementation has a (non-NULL) shared instance of the 36 // Returns true iff the implementation has a (non-NULL) shared instance of the
38 // adapter. Exposed for testing. 37 // adapter. Exposed for testing.
39 static bool HasSharedInstanceForTesting(); 38 static bool HasSharedInstanceForTesting();
40 }; 39 };
41 40
42 } // namespace device 41 } // namespace device
43 42
44 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_FACTORY_H_ 43 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_FACTORY_H_
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_adapter_chromeos.h ('k') | device/bluetooth/bluetooth_adapter_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698