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

Side by Side Diff: chrome/browser/extensions/api/bluetooth/bluetooth_api.cc

Issue 11411130: Implemented BluetoothTaskManagerWin class. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Implemented Unittests Created 8 years 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 | « no previous file | device/DEPS » ('j') | device/bluetooth/bluetooth_polling_thread_win.cc » ('J')
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 "chrome/browser/extensions/api/bluetooth/bluetooth_api.h" 5 #include "chrome/browser/extensions/api/bluetooth/bluetooth_api.h"
6 6
7 #if defined(OS_CHROMEOS) 7 #if defined(OS_CHROMEOS)
8 #include <errno.h> 8 #include <errno.h>
9 #endif 9 #endif
10 10
(...skipping 25 matching lines...) Expand all
36 using device::BluetoothDevice; 36 using device::BluetoothDevice;
37 using device::BluetoothServiceRecord; 37 using device::BluetoothServiceRecord;
38 using device::BluetoothSocket; 38 using device::BluetoothSocket;
39 39
40 namespace { 40 namespace {
41 41
42 extensions::ExtensionBluetoothEventRouter* GetEventRouter(Profile* profile) { 42 extensions::ExtensionBluetoothEventRouter* GetEventRouter(Profile* profile) {
43 return extensions::BluetoothAPI::Get(profile)->bluetooth_event_router(); 43 return extensions::BluetoothAPI::Get(profile)->bluetooth_event_router();
44 } 44 }
45 45
46 const BluetoothAdapter* GetAdapter(Profile* profile) { 46 scoped_refptr<const BluetoothAdapter> GetAdapter(Profile* profile) {
47 return GetEventRouter(profile)->adapter(); 47 return GetEventRouter(profile)->adapter();
48 } 48 }
49 49
50 BluetoothAdapter* GetMutableAdapter(Profile* profile) { 50 scoped_refptr<BluetoothAdapter> GetMutableAdapter(Profile* profile) {
51 return GetEventRouter(profile)->GetMutableAdapter(); 51 return GetEventRouter(profile)->GetMutableAdapter();
52 } 52 }
53 53
54 bool IsBluetoothSupported(Profile* profile) { 54 bool IsBluetoothSupported(Profile* profile) {
55 return GetAdapter(profile) != NULL; 55 return GetAdapter(profile) != NULL;
56 } 56 }
57 57
58 } // namespace 58 } // namespace
59 59
60 namespace { 60 namespace {
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 if (GetEventRouter(profile())->IsResponsibleForDiscovery()) { 619 if (GetEventRouter(profile())->IsResponsibleForDiscovery()) {
620 GetMutableAdapter(profile())->SetDiscovering(false, 620 GetMutableAdapter(profile())->SetDiscovering(false,
621 base::Bind(&BluetoothStopDiscoveryFunction::OnSuccessCallback, this), 621 base::Bind(&BluetoothStopDiscoveryFunction::OnSuccessCallback, this),
622 base::Bind(&BluetoothStopDiscoveryFunction::OnErrorCallback, this)); 622 base::Bind(&BluetoothStopDiscoveryFunction::OnErrorCallback, this));
623 } 623 }
624 return true; 624 return true;
625 } 625 }
626 626
627 } // namespace api 627 } // namespace api
628 } // namespace extensions 628 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | device/DEPS » ('j') | device/bluetooth/bluetooth_polling_thread_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698