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

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

Issue 1367663002: Add Linux support for the Bluetooth API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor_dbus
Patch Set: rebase Created 5 years, 2 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/device_tests.gyp ('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 "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_ = NULL; 56 adapter_ = NULL;
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)
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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 } 420 }
418 421
419 void BluetoothEventRouter::OnExtensionUnloaded( 422 void BluetoothEventRouter::OnExtensionUnloaded(
420 content::BrowserContext* browser_context, 423 content::BrowserContext* browser_context,
421 const Extension* extension, 424 const Extension* extension,
422 UnloadedExtensionInfo::Reason reason) { 425 UnloadedExtensionInfo::Reason reason) {
423 CleanUpForExtension(extension->id()); 426 CleanUpForExtension(extension->id());
424 } 427 }
425 428
426 } // namespace extensions 429 } // namespace extensions
OLDNEW
« no previous file with comments | « device/device_tests.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698