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

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

Issue 2564113003: bluetooth: Add basic scanning to chrome://bluetooth-internals. (Closed)
Patch Set: Update comments 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
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 #include "base/bind_helpers.h"
6 #include "device/bluetooth/discovery_session.h"
7
8 namespace bluetooth {
9 DiscoverySession::DiscoverySession(
10 std::unique_ptr<device::BluetoothDiscoverySession> session)
11 : discovery_session_(std::move(session)), weak_ptr_factory_(this) {}
12
13 DiscoverySession::~DiscoverySession() {}
14
15 void DiscoverySession::IsActive(const IsActiveCallback& callback) {
16 callback.Run(discovery_session_->IsActive());
17 }
18
19 void DiscoverySession::Stop(const StopCallback& callback) {
20 discovery_session_->Stop(
21 base::Bind(&DiscoverySession::OnStop, weak_ptr_factory_.GetWeakPtr(),
22 callback),
23 base::Bind(&DiscoverySession::OnStopError, weak_ptr_factory_.GetWeakPtr(),
24 callback));
25 }
26
27 void DiscoverySession::OnStop(const StopCallback& callback) {
28 callback.Run(true /* success */);
29 }
30
31 void DiscoverySession::OnStopError(const StopCallback& callback) {
32 callback.Run(false /* success */);
33 }
34
35 } // namespace bluetooth
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698