OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 EXTENSIONS_BROWSER_API_BLUETOOTH_BLUETOOTH_PRIVATE_API_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_BLUETOOTH_BLUETOOTH_PRIVATE_API_H_ |
6 #define EXTENSIONS_BROWSER_API_BLUETOOTH_BLUETOOTH_PRIVATE_API_H_ | 6 #define EXTENSIONS_BROWSER_API_BLUETOOTH_BLUETOOTH_PRIVATE_API_H_ |
7 | 7 |
8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
9 #include "extensions/browser/api/bluetooth/bluetooth_extension_function.h" | 9 #include "extensions/browser/api/bluetooth/bluetooth_extension_function.h" |
10 #include "extensions/browser/browser_context_keyed_api_factory.h" | 10 #include "extensions/browser/browser_context_keyed_api_factory.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 class BluetoothPrivateAPI : public BrowserContextKeyedAPI, | 22 class BluetoothPrivateAPI : public BrowserContextKeyedAPI, |
23 public EventRouter::Observer { | 23 public EventRouter::Observer { |
24 public: | 24 public: |
25 static BrowserContextKeyedAPIFactory<BluetoothPrivateAPI>* | 25 static BrowserContextKeyedAPIFactory<BluetoothPrivateAPI>* |
26 GetFactoryInstance(); | 26 GetFactoryInstance(); |
27 | 27 |
28 explicit BluetoothPrivateAPI(content::BrowserContext* context); | 28 explicit BluetoothPrivateAPI(content::BrowserContext* context); |
29 virtual ~BluetoothPrivateAPI(); | 29 virtual ~BluetoothPrivateAPI(); |
30 | 30 |
31 // KeyedService implementation. | 31 // KeyedService implementation. |
32 virtual void Shutdown() OVERRIDE; | 32 virtual void Shutdown() override; |
33 | 33 |
34 // EventRouter::Observer implementation. | 34 // EventRouter::Observer implementation. |
35 virtual void OnListenerAdded(const EventListenerInfo& details) OVERRIDE; | 35 virtual void OnListenerAdded(const EventListenerInfo& details) override; |
36 virtual void OnListenerRemoved(const EventListenerInfo& details) OVERRIDE; | 36 virtual void OnListenerRemoved(const EventListenerInfo& details) override; |
37 | 37 |
38 // BrowserContextKeyedAPI implementation. | 38 // BrowserContextKeyedAPI implementation. |
39 static const char* service_name() { return "BluetoothPrivateAPI"; } | 39 static const char* service_name() { return "BluetoothPrivateAPI"; } |
40 static const bool kServiceRedirectedInIncognito = true; | 40 static const bool kServiceRedirectedInIncognito = true; |
41 static const bool kServiceIsNULLWhileTesting = true; | 41 static const bool kServiceIsNULLWhileTesting = true; |
42 | 42 |
43 private: | 43 private: |
44 friend class BrowserContextKeyedAPIFactory<BluetoothPrivateAPI>; | 44 friend class BrowserContextKeyedAPIFactory<BluetoothPrivateAPI>; |
45 | 45 |
46 content::BrowserContext* browser_context_; | 46 content::BrowserContext* browser_context_; |
(...skipping 11 matching lines...) Expand all Loading... |
58 private: | 58 private: |
59 virtual ~BluetoothPrivateSetAdapterStateFunction(); | 59 virtual ~BluetoothPrivateSetAdapterStateFunction(); |
60 | 60 |
61 base::Closure CreatePropertySetCallback(const std::string& property_name); | 61 base::Closure CreatePropertySetCallback(const std::string& property_name); |
62 base::Closure CreatePropertyErrorCallback(const std::string& property_name); | 62 base::Closure CreatePropertyErrorCallback(const std::string& property_name); |
63 void OnAdapterPropertySet(const std::string& property); | 63 void OnAdapterPropertySet(const std::string& property); |
64 void OnAdapterPropertyError(const std::string& property); | 64 void OnAdapterPropertyError(const std::string& property); |
65 void SendError(); | 65 void SendError(); |
66 | 66 |
67 // BluetoothExtensionFunction overrides: | 67 // BluetoothExtensionFunction overrides: |
68 virtual bool DoWork(scoped_refptr<device::BluetoothAdapter> adapter) OVERRIDE; | 68 virtual bool DoWork(scoped_refptr<device::BluetoothAdapter> adapter) override; |
69 | 69 |
70 // Set of expected adapter properties to be changed. | 70 // Set of expected adapter properties to be changed. |
71 std::set<std::string> pending_properties_; | 71 std::set<std::string> pending_properties_; |
72 | 72 |
73 // Set of adapter properties that were not set successfully. | 73 // Set of adapter properties that were not set successfully. |
74 std::set<std::string> failed_properties_; | 74 std::set<std::string> failed_properties_; |
75 | 75 |
76 DISALLOW_COPY_AND_ASSIGN(BluetoothPrivateSetAdapterStateFunction); | 76 DISALLOW_COPY_AND_ASSIGN(BluetoothPrivateSetAdapterStateFunction); |
77 }; | 77 }; |
78 | 78 |
79 class BluetoothPrivateSetPairingResponseFunction | 79 class BluetoothPrivateSetPairingResponseFunction |
80 : public BluetoothExtensionFunction { | 80 : public BluetoothExtensionFunction { |
81 public: | 81 public: |
82 DECLARE_EXTENSION_FUNCTION("bluetoothPrivate.setPairingResponse", | 82 DECLARE_EXTENSION_FUNCTION("bluetoothPrivate.setPairingResponse", |
83 BLUETOOTHPRIVATE_SETPAIRINGRESPONSE) | 83 BLUETOOTHPRIVATE_SETPAIRINGRESPONSE) |
84 BluetoothPrivateSetPairingResponseFunction(); | 84 BluetoothPrivateSetPairingResponseFunction(); |
85 // BluetoothExtensionFunction overrides: | 85 // BluetoothExtensionFunction overrides: |
86 virtual bool DoWork(scoped_refptr<device::BluetoothAdapter> adapter) OVERRIDE; | 86 virtual bool DoWork(scoped_refptr<device::BluetoothAdapter> adapter) override; |
87 | 87 |
88 private: | 88 private: |
89 virtual ~BluetoothPrivateSetPairingResponseFunction(); | 89 virtual ~BluetoothPrivateSetPairingResponseFunction(); |
90 DISALLOW_COPY_AND_ASSIGN(BluetoothPrivateSetPairingResponseFunction); | 90 DISALLOW_COPY_AND_ASSIGN(BluetoothPrivateSetPairingResponseFunction); |
91 }; | 91 }; |
92 | 92 |
93 } // namespace core_api | 93 } // namespace core_api |
94 | 94 |
95 } // namespace extensions | 95 } // namespace extensions |
96 | 96 |
97 #endif // EXTENSIONS_BROWSER_API_BLUETOOTH_BLUETOOTH_PRIVATE_API_H_ | 97 #endif // EXTENSIONS_BROWSER_API_BLUETOOTH_BLUETOOTH_PRIVATE_API_H_ |
OLD | NEW |