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

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

Issue 2223203002: arc: bluetooth: Add/Remove BT observer only when ARC is ready (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nit in last patch Created 4 years, 4 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/bluetooth_adapter.h ('k') | no next file » | 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 #include "device/bluetooth/bluetooth_adapter.h" 5 #include "device/bluetooth/bluetooth_adapter.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 void BluetoothAdapter::AddObserver(BluetoothAdapter::Observer* observer) { 48 void BluetoothAdapter::AddObserver(BluetoothAdapter::Observer* observer) {
49 DCHECK(observer); 49 DCHECK(observer);
50 observers_.AddObserver(observer); 50 observers_.AddObserver(observer);
51 } 51 }
52 52
53 void BluetoothAdapter::RemoveObserver(BluetoothAdapter::Observer* observer) { 53 void BluetoothAdapter::RemoveObserver(BluetoothAdapter::Observer* observer) {
54 DCHECK(observer); 54 DCHECK(observer);
55 observers_.RemoveObserver(observer); 55 observers_.RemoveObserver(observer);
56 } 56 }
57 57
58 bool BluetoothAdapter::HasObserver(BluetoothAdapter::Observer* observer) {
59 DCHECK(observer);
60 return observers_.HasObserver(observer);
61 }
62
58 void BluetoothAdapter::StartDiscoverySession( 63 void BluetoothAdapter::StartDiscoverySession(
59 const DiscoverySessionCallback& callback, 64 const DiscoverySessionCallback& callback,
60 const ErrorCallback& error_callback) { 65 const ErrorCallback& error_callback) {
61 StartDiscoverySessionWithFilter(nullptr, callback, error_callback); 66 StartDiscoverySessionWithFilter(nullptr, callback, error_callback);
62 } 67 }
63 68
64 void BluetoothAdapter::StartDiscoverySessionWithFilter( 69 void BluetoothAdapter::StartDiscoverySessionWithFilter(
65 std::unique_ptr<BluetoothDiscoveryFilter> discovery_filter, 70 std::unique_ptr<BluetoothDiscoveryFilter> discovery_filter,
66 const DiscoverySessionCallback& callback, 71 const DiscoverySessionCallback& callback,
67 const ErrorCallback& error_callback) { 72 const ErrorCallback& error_callback) {
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 UMA_HISTOGRAM_ENUMERATION( 416 UMA_HISTOGRAM_ENUMERATION(
412 "Bluetooth.DiscoverySession.Stop.Outcome", static_cast<int>(outcome), 417 "Bluetooth.DiscoverySession.Stop.Outcome", static_cast<int>(outcome),
413 static_cast<int>(UMABluetoothDiscoverySessionOutcome::COUNT)); 418 static_cast<int>(UMABluetoothDiscoverySessionOutcome::COUNT));
414 } 419 }
415 420
416 // static 421 // static
417 const base::TimeDelta BluetoothAdapter::timeoutSec = 422 const base::TimeDelta BluetoothAdapter::timeoutSec =
418 base::TimeDelta::FromSeconds(180); 423 base::TimeDelta::FromSeconds(180);
419 424
420 } // namespace device 425 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_adapter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698