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

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

Issue 10007008: Add support for creating bluetooth RFCOMM sockets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: adding disconnect Created 8 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 | Annotate | Revision Log
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 #ifndef CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_
7 #pragma once 7 #pragma once
8 8
9 #include "chrome/browser/extensions/extension_function.h" 9 #include "chrome/browser/extensions/extension_function.h"
10 10
11 #if defined(OS_CHROMEOS) 11 #if defined(OS_CHROMEOS)
12 #include "chrome/browser/chromeos/bluetooth/bluetooth_adapter.h" 12 #include "chrome/browser/chromeos/bluetooth/bluetooth_adapter.h"
13 #endif 13 #endif
14 14
15 namespace extensions { 15 namespace extensions {
16 namespace api { 16 namespace api {
17 17
18 class BluetoothExtensionFunction : public SyncExtensionFunction { 18 class BluetoothExtensionFunction : public SyncExtensionFunction {
19 public: 19 public:
20 BluetoothExtensionFunction(); 20 BluetoothExtensionFunction();
21 21
22 protected: 22 protected:
23 #if defined(OS_CHROMEOS) 23 #if defined(OS_CHROMEOS)
24 const chromeos::BluetoothAdapter* adapter_; 24 const chromeos::BluetoothAdapter* const_adapter_;
25 chromeos::BluetoothAdapter* adapter_;
25 #endif 26 #endif
26 }; 27 };
27 28
28 class BluetoothIsAvailableFunction : public BluetoothExtensionFunction { 29 class BluetoothIsAvailableFunction : public BluetoothExtensionFunction {
29 public: 30 public:
30 virtual bool RunImpl() OVERRIDE; 31 virtual bool RunImpl() OVERRIDE;
31 DECLARE_EXTENSION_FUNCTION_NAME("experimental.bluetooth.isAvailable") 32 DECLARE_EXTENSION_FUNCTION_NAME("experimental.bluetooth.isAvailable")
32 }; 33 };
33 34
34 class BluetoothIsPoweredFunction : public BluetoothExtensionFunction { 35 class BluetoothIsPoweredFunction : public BluetoothExtensionFunction {
35 public: 36 public:
36 virtual bool RunImpl() OVERRIDE; 37 virtual bool RunImpl() OVERRIDE;
37 DECLARE_EXTENSION_FUNCTION_NAME("experimental.bluetooth.isPowered") 38 DECLARE_EXTENSION_FUNCTION_NAME("experimental.bluetooth.isPowered")
38 }; 39 };
39 40
40 class BluetoothGetAddressFunction : public BluetoothExtensionFunction { 41 class BluetoothGetAddressFunction : public BluetoothExtensionFunction {
41 public: 42 public:
42 virtual bool RunImpl() OVERRIDE; 43 virtual bool RunImpl() OVERRIDE;
43 DECLARE_EXTENSION_FUNCTION_NAME("experimental.bluetooth.getAddress") 44 DECLARE_EXTENSION_FUNCTION_NAME("experimental.bluetooth.getAddress")
44 }; 45 };
45 46
46 class BluetoothGetDevicesWithServiceFunction 47 class BluetoothGetDevicesWithServiceFunction
47 : public BluetoothExtensionFunction { 48 : public BluetoothExtensionFunction {
48 public: 49 public:
49 virtual bool RunImpl() OVERRIDE; 50 virtual bool RunImpl() OVERRIDE;
50 DECLARE_EXTENSION_FUNCTION_NAME( 51 DECLARE_EXTENSION_FUNCTION_NAME(
51 "experimental.bluetooth.getDevicesWithService") 52 "experimental.bluetooth.getDevicesWithService")
52 }; 53 };
53 54
55 class BluetoothConnectFunction : public BluetoothExtensionFunction {
56 public:
57 virtual bool RunImpl() OVERRIDE;
58 DECLARE_EXTENSION_FUNCTION_NAME("experimental.bluetooth.connect")
59 };
60
54 class BluetoothDisconnectFunction : public BluetoothExtensionFunction { 61 class BluetoothDisconnectFunction : public BluetoothExtensionFunction {
55 public: 62 public:
56 virtual bool RunImpl() OVERRIDE; 63 virtual bool RunImpl() OVERRIDE;
57 DECLARE_EXTENSION_FUNCTION_NAME("experimental.bluetooth.disconnect") 64 DECLARE_EXTENSION_FUNCTION_NAME("experimental.bluetooth.disconnect")
58 }; 65 };
59 66
60 class BluetoothReadFunction : public BluetoothExtensionFunction { 67 class BluetoothReadFunction : public BluetoothExtensionFunction {
61 public: 68 public:
62 virtual bool RunImpl() OVERRIDE; 69 virtual bool RunImpl() OVERRIDE;
63 DECLARE_EXTENSION_FUNCTION_NAME("experimental.bluetooth.read") 70 DECLARE_EXTENSION_FUNCTION_NAME("experimental.bluetooth.read")
(...skipping 14 matching lines...) Expand all
78 DECLARE_EXTENSION_FUNCTION_NAME( 85 DECLARE_EXTENSION_FUNCTION_NAME(
79 "experimental.bluetooth.getOutOfBandPairingData") 86 "experimental.bluetooth.getOutOfBandPairingData")
80 }; 87 };
81 88
82 class BluetoothWriteFunction : public BluetoothExtensionFunction { 89 class BluetoothWriteFunction : public BluetoothExtensionFunction {
83 public: 90 public:
84 virtual bool RunImpl() OVERRIDE; 91 virtual bool RunImpl() OVERRIDE;
85 DECLARE_EXTENSION_FUNCTION_NAME("experimental.bluetooth.write") 92 DECLARE_EXTENSION_FUNCTION_NAME("experimental.bluetooth.write")
86 }; 93 };
87 94
88 class BluetoothConnectFunction : public BluetoothExtensionFunction {
89 public:
90 virtual bool RunImpl() OVERRIDE;
91 DECLARE_EXTENSION_FUNCTION_NAME("experimental.bluetooth.connect")
92 };
93
94 } // namespace api 95 } // namespace api
95 } // namespace extensions 96 } // namespace extensions
96 97
97 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_ 98 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698