| 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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 114 |
| 115 // Base class for methods dealing with BluetoothSocketApi and | 115 // Base class for methods dealing with BluetoothSocketApi and |
| 116 // ApiResourceManager<BluetoothSocketApi>. | 116 // ApiResourceManager<BluetoothSocketApi>. |
| 117 class BluetoothSocketApiFunction : public UIThreadExtensionFunction { | 117 class BluetoothSocketApiFunction : public UIThreadExtensionFunction { |
| 118 public: | 118 public: |
| 119 BluetoothSocketApiFunction(); | 119 BluetoothSocketApiFunction(); |
| 120 | 120 |
| 121 protected: | 121 protected: |
| 122 virtual ~BluetoothSocketApiFunction(); | 122 virtual ~BluetoothSocketApiFunction(); |
| 123 | 123 |
| 124 // ExtensionFunction::RunImpl() | 124 // ExtensionFunction::RunSync() |
| 125 virtual bool RunImpl() OVERRIDE; | 125 virtual bool RunSync() OVERRIDE; |
| 126 | 126 |
| 127 bool PrePrepare(); | 127 bool PrePrepare(); |
| 128 bool Respond(); | 128 bool Respond(); |
| 129 void AsyncWorkCompleted(); | 129 void AsyncWorkCompleted(); |
| 130 | 130 |
| 131 virtual bool Prepare() = 0; | 131 virtual bool Prepare() = 0; |
| 132 virtual void Work(); | 132 virtual void Work(); |
| 133 virtual void AsyncWorkStart(); | 133 virtual void AsyncWorkStart(); |
| 134 | 134 |
| 135 content::BrowserThread::ID work_thread_id() const { | 135 content::BrowserThread::ID work_thread_id() const { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 }; | 175 }; |
| 176 | 176 |
| 177 class BluetoothAddProfileFunction : public UIThreadExtensionFunction { | 177 class BluetoothAddProfileFunction : public UIThreadExtensionFunction { |
| 178 public: | 178 public: |
| 179 DECLARE_EXTENSION_FUNCTION("bluetooth.addProfile", BLUETOOTH_ADDPROFILE) | 179 DECLARE_EXTENSION_FUNCTION("bluetooth.addProfile", BLUETOOTH_ADDPROFILE) |
| 180 | 180 |
| 181 BluetoothAddProfileFunction(); | 181 BluetoothAddProfileFunction(); |
| 182 | 182 |
| 183 protected: | 183 protected: |
| 184 virtual ~BluetoothAddProfileFunction(); | 184 virtual ~BluetoothAddProfileFunction(); |
| 185 virtual bool RunImpl() OVERRIDE; | 185 virtual bool RunSync() OVERRIDE; |
| 186 | 186 |
| 187 virtual void RegisterProfile( | 187 virtual void RegisterProfile( |
| 188 const device::BluetoothProfile::Options& options, | 188 const device::BluetoothProfile::Options& options, |
| 189 const device::BluetoothProfile::ProfileCallback& callback); | 189 const device::BluetoothProfile::ProfileCallback& callback); |
| 190 | 190 |
| 191 private: | 191 private: |
| 192 void OnProfileRegistered(device::BluetoothProfile* bluetooth_profile); | 192 void OnProfileRegistered(device::BluetoothProfile* bluetooth_profile); |
| 193 | 193 |
| 194 device::BluetoothUUID uuid_; | 194 device::BluetoothUUID uuid_; |
| 195 }; | 195 }; |
| 196 | 196 |
| 197 class BluetoothRemoveProfileFunction : public SyncExtensionFunction { | 197 class BluetoothRemoveProfileFunction : public SyncExtensionFunction { |
| 198 public: | 198 public: |
| 199 DECLARE_EXTENSION_FUNCTION("bluetooth.removeProfile", | 199 DECLARE_EXTENSION_FUNCTION("bluetooth.removeProfile", |
| 200 BLUETOOTH_REMOVEPROFILE) | 200 BLUETOOTH_REMOVEPROFILE) |
| 201 | 201 |
| 202 protected: | 202 protected: |
| 203 virtual ~BluetoothRemoveProfileFunction(); | 203 virtual ~BluetoothRemoveProfileFunction(); |
| 204 virtual bool RunImpl() OVERRIDE; | 204 virtual bool RunSync() OVERRIDE; |
| 205 }; | 205 }; |
| 206 | 206 |
| 207 class BluetoothConnectFunction : public BluetoothExtensionFunction { | 207 class BluetoothConnectFunction : public BluetoothExtensionFunction { |
| 208 public: | 208 public: |
| 209 DECLARE_EXTENSION_FUNCTION("bluetooth.connect", BLUETOOTH_CONNECT) | 209 DECLARE_EXTENSION_FUNCTION("bluetooth.connect", BLUETOOTH_CONNECT) |
| 210 | 210 |
| 211 protected: | 211 protected: |
| 212 virtual ~BluetoothConnectFunction(); | 212 virtual ~BluetoothConnectFunction(); |
| 213 | 213 |
| 214 // BluetoothExtensionFunction: | 214 // BluetoothExtensionFunction: |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 | 382 |
| 383 private: | 383 private: |
| 384 void OnSuccessCallback(); | 384 void OnSuccessCallback(); |
| 385 void OnErrorCallback(); | 385 void OnErrorCallback(); |
| 386 }; | 386 }; |
| 387 | 387 |
| 388 } // namespace api | 388 } // namespace api |
| 389 } // namespace extensions | 389 } // namespace extensions |
| 390 | 390 |
| 391 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_ | 391 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_ |
| OLD | NEW |