| 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 EXTENSIONS_BROWSER_API_BLUETOOTH_BLUETOOTH_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_ | 6 #define EXTENSIONS_BROWSER_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" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "chrome/browser/extensions/api/bluetooth/bluetooth_extension_function.h
" | |
| 13 #include "chrome/common/extensions/api/bluetooth.h" | |
| 14 #include "device/bluetooth/bluetooth_device.h" | 12 #include "device/bluetooth/bluetooth_device.h" |
| 13 #include "extensions/browser/api/bluetooth/bluetooth_extension_function.h" |
| 15 #include "extensions/browser/browser_context_keyed_api_factory.h" | 14 #include "extensions/browser/browser_context_keyed_api_factory.h" |
| 16 #include "extensions/browser/event_router.h" | 15 #include "extensions/browser/event_router.h" |
| 17 #include "extensions/browser/extension_function.h" | 16 #include "extensions/browser/extension_function.h" |
| 17 #include "extensions/common/api/bluetooth.h" |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 class BrowserContext; | 20 class BrowserContext; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace device { | 23 namespace device { |
| 24 class BluetoothAdapter; | 24 class BluetoothAdapter; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace extensions { | 27 namespace extensions { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 57 static const char* service_name() { return "BluetoothAPI"; } | 57 static const char* service_name() { return "BluetoothAPI"; } |
| 58 static const bool kServiceRedirectedInIncognito = true; | 58 static const bool kServiceRedirectedInIncognito = true; |
| 59 static const bool kServiceIsNULLWhileTesting = true; | 59 static const bool kServiceIsNULLWhileTesting = true; |
| 60 | 60 |
| 61 content::BrowserContext* browser_context_; | 61 content::BrowserContext* browser_context_; |
| 62 | 62 |
| 63 // Created lazily on first access. | 63 // Created lazily on first access. |
| 64 scoped_ptr<BluetoothEventRouter> event_router_; | 64 scoped_ptr<BluetoothEventRouter> event_router_; |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 namespace api { | 67 namespace core_api { |
| 68 | 68 |
| 69 class BluetoothGetAdapterStateFunction : public BluetoothExtensionFunction { | 69 class BluetoothGetAdapterStateFunction : public BluetoothExtensionFunction { |
| 70 public: | 70 public: |
| 71 DECLARE_EXTENSION_FUNCTION("bluetooth.getAdapterState", | 71 DECLARE_EXTENSION_FUNCTION("bluetooth.getAdapterState", |
| 72 BLUETOOTH_GETADAPTERSTATE) | 72 BLUETOOTH_GETADAPTERSTATE) |
| 73 | 73 |
| 74 protected: | 74 protected: |
| 75 virtual ~BluetoothGetAdapterStateFunction(); | 75 virtual ~BluetoothGetAdapterStateFunction(); |
| 76 | 76 |
| 77 // BluetoothExtensionFunction: | 77 // BluetoothExtensionFunction: |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 virtual ~BluetoothStopDiscoveryFunction() {} | 124 virtual ~BluetoothStopDiscoveryFunction() {} |
| 125 | 125 |
| 126 // BluetoothExtensionFunction: | 126 // BluetoothExtensionFunction: |
| 127 virtual bool DoWork(scoped_refptr<device::BluetoothAdapter> adapter) OVERRIDE; | 127 virtual bool DoWork(scoped_refptr<device::BluetoothAdapter> adapter) OVERRIDE; |
| 128 | 128 |
| 129 private: | 129 private: |
| 130 void OnSuccessCallback(); | 130 void OnSuccessCallback(); |
| 131 void OnErrorCallback(); | 131 void OnErrorCallback(); |
| 132 }; | 132 }; |
| 133 | 133 |
| 134 } // namespace api | 134 } // namespace core_api |
| 135 } // namespace extensions | 135 } // namespace extensions |
| 136 | 136 |
| 137 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_ | 137 #endif // EXTENSIONS_BROWSER_API_BLUETOOTH_BLUETOOTH_API_H_ |
| OLD | NEW |