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

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

Issue 2379573006: bluetooth: Standardize Bluetooth adapter access in Adapter service. (Closed)
Patch Set: Globalize client to receive callback events 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef DEVICE_BLUETOOTH_ADAPTER_FACTORY_H_
6 #define DEVICE_BLUETOOTH_ADAPTER_FACTORY_H_
7
8 #include "base/macros.h"
9 #include "device/bluetooth/bluetooth_adapter.h"
10 #include "device/bluetooth/public/interfaces/adapter.mojom.h"
11
12 namespace bluetooth {
13
14 // Implementation of Mojo AdapterFactory located in
15 // device/bluetooth/public/interfaces/adapter.mojom.
16 // It handles requests for Mojo Adapter instances
17 // and strongly binds the Adapter instance to the system's
18 // Bluetooth adapter.
19 class AdapterFactory : public mojom::AdapterFactory {
20 public:
21 AdapterFactory();
22 ~AdapterFactory() override;
23
24 // Creates an AdapterFactory with a strong Mojo binding to |request|.
25 static void Create(mojom::AdapterFactoryRequest request);
26
27 // mojom::AdapterFactory overrides:
28 void GetAdapter(const GetAdapterCallback& callback) override;
29
30 private:
31 void OnGetAdapter(const GetAdapterCallback& callback,
32 scoped_refptr<device::BluetoothAdapter> adapter);
33
34 base::WeakPtrFactory<AdapterFactory> weak_ptr_factory_;
35
36 DISALLOW_COPY_AND_ASSIGN(AdapterFactory);
37 };
38
39 } // namespace bluetooth
40
41 #endif // DEVICE_BLUETOOTH_ADAPTER_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698