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

Side by Side Diff: extensions/browser/api/bluetooth/bluetooth_event_router.cc

Issue 2808353004: bluetooth: Rename Is*Available to Is*Supported (Closed)
Patch Set: Add const Created 3 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 "extensions/browser/api/bluetooth/bluetooth_event_router.h" 5 #include "extensions/browser/api/bluetooth/bluetooth_event_router.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 BluetoothEventRouter::~BluetoothEventRouter() { 66 BluetoothEventRouter::~BluetoothEventRouter() {
67 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 67 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
68 if (adapter_.get()) { 68 if (adapter_.get()) {
69 adapter_->RemoveObserver(this); 69 adapter_->RemoveObserver(this);
70 adapter_ = nullptr; 70 adapter_ = nullptr;
71 } 71 }
72 CleanUpAllExtensions(); 72 CleanUpAllExtensions();
73 } 73 }
74 74
75 bool BluetoothEventRouter::IsBluetoothSupported() const { 75 bool BluetoothEventRouter::IsBluetoothSupported() const {
76 return adapter_.get() || 76 return device::BluetoothAdapterFactory::IsBluetoothSupported();
77 device::BluetoothAdapterFactory::IsBluetoothAdapterAvailable();
78 } 77 }
79 78
80 void BluetoothEventRouter::GetAdapter( 79 void BluetoothEventRouter::GetAdapter(
81 const device::BluetoothAdapterFactory::AdapterCallback& callback) { 80 const device::BluetoothAdapterFactory::AdapterCallback& callback) {
82 if (adapter_.get()) { 81 if (adapter_.get()) {
83 callback.Run(scoped_refptr<device::BluetoothAdapter>(adapter_)); 82 callback.Run(scoped_refptr<device::BluetoothAdapter>(adapter_));
84 return; 83 return;
85 } 84 }
86 85
87 device::BluetoothAdapterFactory::GetAdapter( 86 device::BluetoothAdapterFactory::GetAdapter(
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 } 466 }
468 467
469 void BluetoothEventRouter::OnExtensionUnloaded( 468 void BluetoothEventRouter::OnExtensionUnloaded(
470 content::BrowserContext* browser_context, 469 content::BrowserContext* browser_context,
471 const Extension* extension, 470 const Extension* extension,
472 UnloadedExtensionInfo::Reason reason) { 471 UnloadedExtensionInfo::Reason reason) {
473 CleanUpForExtension(extension->id()); 472 CleanUpForExtension(extension->id());
474 } 473 }
475 474
476 } // namespace extensions 475 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698