OLD | NEW |
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 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 #if defined(OS_CHROMEOS) | 88 #if defined(OS_CHROMEOS) |
89 void AddDeviceIfTrue( | 89 void AddDeviceIfTrue( |
90 ListValue* list, const chromeos::BluetoothDevice* device, bool result); | 90 ListValue* list, const chromeos::BluetoothDevice* device, bool result); |
91 | 91 |
92 int callbacks_pending_; | 92 int callbacks_pending_; |
93 #endif | 93 #endif |
94 }; | 94 }; |
95 | 95 |
96 class BluetoothConnectFunction : public AsyncExtensionFunction { | 96 class BluetoothConnectFunction : public AsyncExtensionFunction { |
97 public: | 97 public: |
| 98 DECLARE_EXTENSION_FUNCTION_NAME("experimental.bluetooth.connect") |
| 99 |
| 100 protected: |
| 101 virtual ~BluetoothConnectFunction() {} |
| 102 |
98 virtual bool RunImpl() OVERRIDE; | 103 virtual bool RunImpl() OVERRIDE; |
99 DECLARE_EXTENSION_FUNCTION_NAME("experimental.bluetooth.connect") | |
100 | 104 |
101 private: | 105 private: |
102 #if defined(OS_CHROMEOS) | 106 #if defined(OS_CHROMEOS) |
103 void ConnectToServiceCallback( | 107 void ConnectToServiceCallback( |
104 const chromeos::BluetoothDevice* device, | 108 const chromeos::BluetoothDevice* device, |
105 const std::string& service_uuid, | 109 const std::string& service_uuid, |
106 scoped_refptr<chromeos::BluetoothSocket> socket); | 110 scoped_refptr<chromeos::BluetoothSocket> socket); |
107 #endif | 111 #endif |
108 }; | 112 }; |
109 | 113 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 virtual ~BluetoothWriteFunction() {} | 167 virtual ~BluetoothWriteFunction() {} |
164 | 168 |
165 // ExtensionFunction: | 169 // ExtensionFunction: |
166 virtual bool RunImpl() OVERRIDE; | 170 virtual bool RunImpl() OVERRIDE; |
167 }; | 171 }; |
168 | 172 |
169 } // namespace api | 173 } // namespace api |
170 } // namespace extensions | 174 } // namespace extensions |
171 | 175 |
172 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_ | 176 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_ |
OLD | NEW |