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

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

Issue 2564113003: bluetooth: Add basic scanning to chrome://bluetooth-internals. (Closed)
Patch Set: Replace discovering string in bluetooth_internals.js Created 3 years, 11 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/adapter.cc ('k') | device/bluetooth/discovery_session.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 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_DISCOVERY_SESSION_H_
6 #define DEVICE_BLUETOOTH_DISCOVERY_SESSION_H_
7
8 #include "base/memory/ptr_util.h"
9 #include "device/bluetooth/bluetooth_discovery_session.h"
10 #include "device/bluetooth/public/interfaces/adapter.mojom.h"
11
12 namespace bluetooth {
13
14 // Implementation of Mojo DiscoverySession in
15 // device/bluetooth/public/interfaces/adapter.mojom.
16 // It handles requests to interact with a DiscoverySession.
17 // Uses the platform abstraction of device/bluetooth.
18 // An instance of this class is constructed by Adapter and strongly bound
19 // to its MessagePipe. When the instance is destroyed, the underlying
20 // BluetoothDiscoverySession is requested to stop. Users are encouraged to call
21 // DiscoverySession::Stop in order to respond to a failed request to stop
22 // device discovery.
23 class DiscoverySession : public mojom::DiscoverySession {
24 public:
25 explicit DiscoverySession(
26 std::unique_ptr<device::BluetoothDiscoverySession> session);
27 ~DiscoverySession() override;
28
29 // mojom::DiscoverySession overrides:
30 void IsActive(const IsActiveCallback& callback) override;
31 void Stop(const StopCallback& callback) override;
32
33 private:
34 void OnStop(const StopCallback& callback);
35 void OnStopError(const StopCallback& callback);
36
37 // The underlying discovery session.
38 std::unique_ptr<device::BluetoothDiscoverySession> discovery_session_;
39
40 base::WeakPtrFactory<DiscoverySession> weak_ptr_factory_;
41
42 DISALLOW_COPY_AND_ASSIGN(DiscoverySession);
43 };
44
45 } // namespace bluetooth
46
47 #endif
OLDNEW
« no previous file with comments | « device/bluetooth/adapter.cc ('k') | device/bluetooth/discovery_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698