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

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

Issue 1415573014: Reland "Add Linux support for the Bluetooth API" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: build fix. Created 5 years, 1 month 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 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 BluetoothEventRouter::~BluetoothEventRouter() { 52 BluetoothEventRouter::~BluetoothEventRouter() {
53 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 53 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
54 if (adapter_.get()) { 54 if (adapter_.get()) {
55 adapter_->RemoveObserver(this); 55 adapter_->RemoveObserver(this);
56 adapter_ = nullptr; 56 adapter_ = nullptr;
57 } 57 }
58 CleanUpAllExtensions(); 58 CleanUpAllExtensions();
59 } 59 }
60 60
61 bool BluetoothEventRouter::IsBluetoothSupported() const { 61 bool BluetoothEventRouter::IsBluetoothSupported() const {
62 #if defined(OS_LINUX)
ortuno 2015/11/06 18:15:41 Don't you need this on BluetoothLowEnergyEventRout
rkc 2015/11/25 00:48:16 BluetoothLowEnergy is not supported.
63 return true;
64 #endif
62 return adapter_.get() || 65 return adapter_.get() ||
63 device::BluetoothAdapterFactory::IsBluetoothAdapterAvailable(); 66 device::BluetoothAdapterFactory::IsBluetoothAdapterAvailable();
64 } 67 }
65 68
66 void BluetoothEventRouter::GetAdapter( 69 void BluetoothEventRouter::GetAdapter(
67 const device::BluetoothAdapterFactory::AdapterCallback& callback) { 70 const device::BluetoothAdapterFactory::AdapterCallback& callback) {
68 if (adapter_.get()) { 71 if (adapter_.get()) {
69 callback.Run(scoped_refptr<device::BluetoothAdapter>(adapter_)); 72 callback.Run(scoped_refptr<device::BluetoothAdapter>(adapter_));
70 return; 73 return;
71 } 74 }
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 } 457 }
455 458
456 void BluetoothEventRouter::OnExtensionUnloaded( 459 void BluetoothEventRouter::OnExtensionUnloaded(
457 content::BrowserContext* browser_context, 460 content::BrowserContext* browser_context,
458 const Extension* extension, 461 const Extension* extension,
459 UnloadedExtensionInfo::Reason reason) { 462 UnloadedExtensionInfo::Reason reason) {
460 CleanUpForExtension(extension->id()); 463 CleanUpForExtension(extension->id());
461 } 464 }
462 465
463 } // namespace extensions 466 } // namespace extensions
OLDNEW
« device/bluetooth/bluetooth_socket_bluez.cc ('K') | « device/device_tests.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698