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

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

Issue 1784333002: Add Device Policy Handler for Bluetooth, and allow disabling the Bluetooth adapter on Chrome OS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made SetDisabled pure virtual Created 4 years, 8 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
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 <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 19 matching lines...) Expand all
30 base::WeakPtr<BluetoothAdapter> BluetoothAdapter::CreateAdapter( 30 base::WeakPtr<BluetoothAdapter> BluetoothAdapter::CreateAdapter(
31 const InitCallback& init_callback) { 31 const InitCallback& init_callback) {
32 return base::WeakPtr<BluetoothAdapter>(); 32 return base::WeakPtr<BluetoothAdapter>();
33 } 33 }
34 #endif // !defined(OS_CHROMEOS) && !defined(OS_WIN) && !defined(OS_MACOSX) 34 #endif // !defined(OS_CHROMEOS) && !defined(OS_WIN) && !defined(OS_MACOSX)
35 35
36 base::WeakPtr<BluetoothAdapter> BluetoothAdapter::GetWeakPtrForTesting() { 36 base::WeakPtr<BluetoothAdapter> BluetoothAdapter::GetWeakPtrForTesting() {
37 return weak_ptr_factory_.GetWeakPtr(); 37 return weak_ptr_factory_.GetWeakPtr();
38 } 38 }
39 39
40 #if defined(OS_CHROMEOS) || defined(OS_LINUX)
41 void BluetoothAdapter::Shutdown() {
Andrew T Wilson (Slow) 2016/04/13 13:55:10 Restore this :)
Ivan Šandrk 2016/04/13 17:19:04 Done.
42 NOTIMPLEMENTED();
43 }
44 #endif
45
46 void BluetoothAdapter::AddObserver(BluetoothAdapter::Observer* observer) { 40 void BluetoothAdapter::AddObserver(BluetoothAdapter::Observer* observer) {
47 DCHECK(observer); 41 DCHECK(observer);
48 observers_.AddObserver(observer); 42 observers_.AddObserver(observer);
49 } 43 }
50 44
51 void BluetoothAdapter::RemoveObserver(BluetoothAdapter::Observer* observer) { 45 void BluetoothAdapter::RemoveObserver(BluetoothAdapter::Observer* observer) {
52 DCHECK(observer); 46 DCHECK(observer);
53 observers_.RemoveObserver(observer); 47 observers_.RemoveObserver(observer);
54 } 48 }
55 49
50 #if defined(OS_CHROMEOS)
51 void BluetoothAdapter::SetDisabled(bool disabled) {
52 NOTIMPLEMENTED();
Andrew T Wilson (Slow) 2016/04/13 13:55:11 Remove this since it's now pure virtual.
Ivan Šandrk 2016/04/13 17:19:04 Done.
53 }
54 #endif
55
56 void BluetoothAdapter::StartDiscoverySession( 56 void BluetoothAdapter::StartDiscoverySession(
57 const DiscoverySessionCallback& callback, 57 const DiscoverySessionCallback& callback,
58 const ErrorCallback& error_callback) { 58 const ErrorCallback& error_callback) {
59 StartDiscoverySessionWithFilter(nullptr, callback, error_callback); 59 StartDiscoverySessionWithFilter(nullptr, callback, error_callback);
60 } 60 }
61 61
62 void BluetoothAdapter::StartDiscoverySessionWithFilter( 62 void BluetoothAdapter::StartDiscoverySessionWithFilter(
63 scoped_ptr<BluetoothDiscoveryFilter> discovery_filter, 63 scoped_ptr<BluetoothDiscoveryFilter> discovery_filter,
64 const DiscoverySessionCallback& callback, 64 const DiscoverySessionCallback& callback,
65 const ErrorCallback& error_callback) { 65 const ErrorCallback& error_callback) {
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 355
356 // static 356 // static
357 void BluetoothAdapter::RecordBluetoothDiscoverySessionStopOutcome( 357 void BluetoothAdapter::RecordBluetoothDiscoverySessionStopOutcome(
358 UMABluetoothDiscoverySessionOutcome outcome) { 358 UMABluetoothDiscoverySessionOutcome outcome) {
359 UMA_HISTOGRAM_ENUMERATION( 359 UMA_HISTOGRAM_ENUMERATION(
360 "Bluetooth.DiscoverySession.Stop.Outcome", static_cast<int>(outcome), 360 "Bluetooth.DiscoverySession.Stop.Outcome", static_cast<int>(outcome),
361 static_cast<int>(UMABluetoothDiscoverySessionOutcome::COUNT)); 361 static_cast<int>(UMABluetoothDiscoverySessionOutcome::COUNT));
362 } 362 }
363 363
364 } // namespace device 364 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698