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 CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_SOCKET_BLUETOOTH_SOCKET_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_SOCKET_BLUETOOTH_SOCKET_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_SOCKET_BLUETOOTH_SOCKET_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_SOCKET_BLUETOOTH_SOCKET_API_H_ |
7 | 7 |
8 #include "extensions/browser/extension_function.h" | 8 #include "extensions/browser/extension_function.h" |
9 #include "extensions/browser/extension_function_histogram_value.h" | 9 #include "extensions/browser/extension_function_histogram_value.h" |
10 | 10 |
11 namespace extensions { | 11 namespace extensions { |
12 namespace api { | 12 namespace api { |
13 | 13 |
14 class BluetoothSocketCreateFunction : public UIThreadExtensionFunction { | 14 class BluetoothSocketCreateFunction : public AsyncExtensionFunction { |
Ken Rockot(use gerrit already)
2014/04/30 22:37:16
nice
| |
15 public: | 15 public: |
16 DECLARE_EXTENSION_FUNCTION("bluetoothSocket.create", BLUETOOTHSOCKET_CREATE); | 16 DECLARE_EXTENSION_FUNCTION("bluetoothSocket.create", BLUETOOTHSOCKET_CREATE); |
17 | 17 |
18 protected: | 18 protected: |
19 virtual ~BluetoothSocketCreateFunction() {} | 19 virtual ~BluetoothSocketCreateFunction() {} |
20 | 20 |
21 // UIThreadExtensionFunction override: | 21 // AsyncExtensionFunction override: |
22 virtual bool RunImpl() OVERRIDE; | 22 virtual bool RunAsync() OVERRIDE; |
23 }; | 23 }; |
24 | 24 |
25 class BluetoothSocketUpdateFunction : public UIThreadExtensionFunction { | 25 class BluetoothSocketUpdateFunction : public AsyncExtensionFunction { |
26 public: | 26 public: |
27 DECLARE_EXTENSION_FUNCTION("bluetoothSocket.update", BLUETOOTHSOCKET_UPDATE); | 27 DECLARE_EXTENSION_FUNCTION("bluetoothSocket.update", BLUETOOTHSOCKET_UPDATE); |
28 | 28 |
29 protected: | 29 protected: |
30 virtual ~BluetoothSocketUpdateFunction() {} | 30 virtual ~BluetoothSocketUpdateFunction() {} |
31 | 31 |
32 // UIThreadExtensionFunction override: | 32 // AsyncExtensionFunction override: |
33 virtual bool RunImpl() OVERRIDE; | 33 virtual bool RunAsync() OVERRIDE; |
34 }; | 34 }; |
35 | 35 |
36 class BluetoothSocketSetPausedFunction : public UIThreadExtensionFunction { | 36 class BluetoothSocketSetPausedFunction : public AsyncExtensionFunction { |
37 public: | 37 public: |
38 DECLARE_EXTENSION_FUNCTION("bluetoothSocket.setPaused", | 38 DECLARE_EXTENSION_FUNCTION("bluetoothSocket.setPaused", |
39 BLUETOOTHSOCKET_SETPAUSED); | 39 BLUETOOTHSOCKET_SETPAUSED); |
40 | 40 |
41 protected: | 41 protected: |
42 virtual ~BluetoothSocketSetPausedFunction() {} | 42 virtual ~BluetoothSocketSetPausedFunction() {} |
43 | 43 |
44 // UIThreadExtensionFunction override: | 44 // AsyncExtensionFunction override: |
45 virtual bool RunImpl() OVERRIDE; | 45 virtual bool RunAsync() OVERRIDE; |
46 }; | 46 }; |
47 | 47 |
48 class BluetoothSocketListenUsingRfcommFunction | 48 class BluetoothSocketListenUsingRfcommFunction : public AsyncExtensionFunction { |
49 : public UIThreadExtensionFunction { | |
50 public: | 49 public: |
51 DECLARE_EXTENSION_FUNCTION("bluetoothSocket.listenUsingRfcomm", | 50 DECLARE_EXTENSION_FUNCTION("bluetoothSocket.listenUsingRfcomm", |
52 BLUETOOTHSOCKET_LISTENUSINGRFCOMM); | 51 BLUETOOTHSOCKET_LISTENUSINGRFCOMM); |
53 | 52 |
54 protected: | 53 protected: |
55 virtual ~BluetoothSocketListenUsingRfcommFunction() {} | 54 virtual ~BluetoothSocketListenUsingRfcommFunction() {} |
56 | 55 |
57 // UIThreadExtensionFunction override: | 56 // AsyncExtensionFunction override: |
58 virtual bool RunImpl() OVERRIDE; | 57 virtual bool RunAsync() OVERRIDE; |
59 }; | 58 }; |
60 | 59 |
61 class BluetoothSocketListenUsingInsecureRfcommFunction | 60 class BluetoothSocketListenUsingInsecureRfcommFunction |
62 : public UIThreadExtensionFunction { | 61 : public AsyncExtensionFunction { |
63 public: | 62 public: |
64 DECLARE_EXTENSION_FUNCTION("bluetoothSocket.listenUsingInsecureRfcomm", | 63 DECLARE_EXTENSION_FUNCTION("bluetoothSocket.listenUsingInsecureRfcomm", |
65 BLUETOOTHSOCKET_LISTENUSINGINSECURERFCOMM); | 64 BLUETOOTHSOCKET_LISTENUSINGINSECURERFCOMM); |
66 | 65 |
67 protected: | 66 protected: |
68 virtual ~BluetoothSocketListenUsingInsecureRfcommFunction() {} | 67 virtual ~BluetoothSocketListenUsingInsecureRfcommFunction() {} |
69 | 68 |
70 // UIThreadExtensionFunction override: | 69 // AsyncExtensionFunction override: |
71 virtual bool RunImpl() OVERRIDE; | 70 virtual bool RunAsync() OVERRIDE; |
72 }; | 71 }; |
73 | 72 |
74 class BluetoothSocketListenUsingL2capFunction | 73 class BluetoothSocketListenUsingL2capFunction : public AsyncExtensionFunction { |
75 : public UIThreadExtensionFunction { | |
76 public: | 74 public: |
77 DECLARE_EXTENSION_FUNCTION("bluetoothSocket.listenUsingL2cap", | 75 DECLARE_EXTENSION_FUNCTION("bluetoothSocket.listenUsingL2cap", |
78 BLUETOOTHSOCKET_LISTENUSINGL2CAP); | 76 BLUETOOTHSOCKET_LISTENUSINGL2CAP); |
79 | 77 |
80 protected: | 78 protected: |
81 virtual ~BluetoothSocketListenUsingL2capFunction() {} | 79 virtual ~BluetoothSocketListenUsingL2capFunction() {} |
82 | 80 |
83 // UIThreadExtensionFunction override: | 81 // AsyncExtensionFunction override: |
84 virtual bool RunImpl() OVERRIDE; | 82 virtual bool RunAsync() OVERRIDE; |
85 }; | 83 }; |
86 | 84 |
87 class BluetoothSocketConnectFunction : public UIThreadExtensionFunction { | 85 class BluetoothSocketConnectFunction : public AsyncExtensionFunction { |
88 public: | 86 public: |
89 DECLARE_EXTENSION_FUNCTION("bluetoothSocket.connect", | 87 DECLARE_EXTENSION_FUNCTION("bluetoothSocket.connect", |
90 BLUETOOTHSOCKET_CONNECT); | 88 BLUETOOTHSOCKET_CONNECT); |
91 | 89 |
92 protected: | 90 protected: |
93 virtual ~BluetoothSocketConnectFunction() {} | 91 virtual ~BluetoothSocketConnectFunction() {} |
94 | 92 |
95 // UIThreadExtensionFunction override: | 93 // AsyncExtensionFunction override: |
96 virtual bool RunImpl() OVERRIDE; | 94 virtual bool RunAsync() OVERRIDE; |
97 }; | 95 }; |
98 | 96 |
99 class BluetoothSocketDisconnectFunction : public UIThreadExtensionFunction { | 97 class BluetoothSocketDisconnectFunction : public AsyncExtensionFunction { |
100 public: | 98 public: |
101 DECLARE_EXTENSION_FUNCTION("bluetoothSocket.disconnect", | 99 DECLARE_EXTENSION_FUNCTION("bluetoothSocket.disconnect", |
102 BLUETOOTHSOCKET_DISCONNECT); | 100 BLUETOOTHSOCKET_DISCONNECT); |
103 | 101 |
104 protected: | 102 protected: |
105 virtual ~BluetoothSocketDisconnectFunction() {} | 103 virtual ~BluetoothSocketDisconnectFunction() {} |
106 | 104 |
107 // UIThreadExtensionFunction override: | 105 // AsyncExtensionFunction override: |
108 virtual bool RunImpl() OVERRIDE; | 106 virtual bool RunAsync() OVERRIDE; |
109 }; | 107 }; |
110 | 108 |
111 class BluetoothSocketCloseFunction : public UIThreadExtensionFunction { | 109 class BluetoothSocketCloseFunction : public AsyncExtensionFunction { |
112 public: | 110 public: |
113 DECLARE_EXTENSION_FUNCTION("bluetoothSocket.close", BLUETOOTHSOCKET_CLOSE); | 111 DECLARE_EXTENSION_FUNCTION("bluetoothSocket.close", BLUETOOTHSOCKET_CLOSE); |
114 | 112 |
115 protected: | 113 protected: |
116 virtual ~BluetoothSocketCloseFunction() {} | 114 virtual ~BluetoothSocketCloseFunction() {} |
117 | 115 |
118 // UIThreadExtensionFunction override: | 116 // AsyncExtensionFunction override: |
119 virtual bool RunImpl() OVERRIDE; | 117 virtual bool RunAsync() OVERRIDE; |
120 }; | 118 }; |
121 | 119 |
122 class BluetoothSocketSendFunction : public UIThreadExtensionFunction { | 120 class BluetoothSocketSendFunction : public AsyncExtensionFunction { |
123 public: | 121 public: |
124 DECLARE_EXTENSION_FUNCTION("bluetoothSocket.send", BLUETOOTHSOCKET_SEND); | 122 DECLARE_EXTENSION_FUNCTION("bluetoothSocket.send", BLUETOOTHSOCKET_SEND); |
125 | 123 |
126 protected: | 124 protected: |
127 virtual ~BluetoothSocketSendFunction() {} | 125 virtual ~BluetoothSocketSendFunction() {} |
128 | 126 |
129 // UIThreadExtensionFunction override: | 127 // AsyncExtensionFunction override: |
130 virtual bool RunImpl() OVERRIDE; | 128 virtual bool RunAsync() OVERRIDE; |
131 }; | 129 }; |
132 | 130 |
133 class BluetoothSocketGetInfoFunction : public UIThreadExtensionFunction { | 131 class BluetoothSocketGetInfoFunction : public AsyncExtensionFunction { |
134 public: | 132 public: |
135 DECLARE_EXTENSION_FUNCTION("bluetoothSocket.getInfo", | 133 DECLARE_EXTENSION_FUNCTION("bluetoothSocket.getInfo", |
136 BLUETOOTHSOCKET_GETINFO); | 134 BLUETOOTHSOCKET_GETINFO); |
137 | 135 |
138 protected: | 136 protected: |
139 virtual ~BluetoothSocketGetInfoFunction() {} | 137 virtual ~BluetoothSocketGetInfoFunction() {} |
140 | 138 |
141 // UIThreadExtensionFunction override: | 139 // AsyncExtensionFunction override: |
142 virtual bool RunImpl() OVERRIDE; | 140 virtual bool RunAsync() OVERRIDE; |
143 }; | 141 }; |
144 | 142 |
145 class BluetoothSocketGetSocketsFunction : public UIThreadExtensionFunction { | 143 class BluetoothSocketGetSocketsFunction : public AsyncExtensionFunction { |
146 public: | 144 public: |
147 DECLARE_EXTENSION_FUNCTION("bluetoothSocket.getSockets", | 145 DECLARE_EXTENSION_FUNCTION("bluetoothSocket.getSockets", |
148 BLUETOOTHSOCKET_GETSOCKETS); | 146 BLUETOOTHSOCKET_GETSOCKETS); |
149 | 147 |
150 protected: | 148 protected: |
151 virtual ~BluetoothSocketGetSocketsFunction() {} | 149 virtual ~BluetoothSocketGetSocketsFunction() {} |
152 | 150 |
153 // UIThreadExtensionFunction override: | 151 // AsyncExtensionFunction override: |
154 virtual bool RunImpl() OVERRIDE; | 152 virtual bool RunAsync() OVERRIDE; |
155 }; | 153 }; |
156 | 154 |
157 } // namespace api | 155 } // namespace api |
158 } // namespace extensions | 156 } // namespace extensions |
159 | 157 |
160 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_SOCKET_BLUETOOTH_SOCKET_API_H _ | 158 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_SOCKET_BLUETOOTH_SOCKET_API_H _ |
OLD | NEW |