Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: chrome/browser/extensions/api/bluetooth/bluetooth_api.h

Issue 10777003: Refactor APIResourceController to ProfileKeyedService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge/antony/fix build. Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "chrome/browser/extensions/api/api_function.h" 10 #include "chrome/browser/extensions/api/api_function.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 public: 124 public:
125 DECLARE_EXTENSION_FUNCTION_NAME("experimental.bluetooth.disconnect") 125 DECLARE_EXTENSION_FUNCTION_NAME("experimental.bluetooth.disconnect")
126 126
127 protected: 127 protected:
128 virtual ~BluetoothDisconnectFunction() {} 128 virtual ~BluetoothDisconnectFunction() {}
129 129
130 // ExtensionFunction: 130 // ExtensionFunction:
131 virtual bool RunImpl() OVERRIDE; 131 virtual bool RunImpl() OVERRIDE;
132 }; 132 };
133 133
134 class BluetoothReadFunction : public AsyncAPIFunction { 134 class BluetoothReadFunction : public AsyncApiFunction {
135 public: 135 public:
136 DECLARE_EXTENSION_FUNCTION_NAME("experimental.bluetooth.read") 136 DECLARE_EXTENSION_FUNCTION_NAME("experimental.bluetooth.read")
137 BluetoothReadFunction(); 137 BluetoothReadFunction();
138 138
139 protected: 139 protected:
140 virtual ~BluetoothReadFunction(); 140 virtual ~BluetoothReadFunction();
141 141
142 // AsyncAPIFunction: 142 // AsyncApiFunction:
143 virtual bool Prepare() OVERRIDE; 143 virtual bool Prepare() OVERRIDE;
144 virtual bool Respond() OVERRIDE; 144 virtual bool Respond() OVERRIDE;
145 virtual void Work() OVERRIDE; 145 virtual void Work() OVERRIDE;
146 146
147 private: 147 private:
148 #if defined(OS_CHROMEOS) 148 #if defined(OS_CHROMEOS)
149 bool success_; 149 bool success_;
150 scoped_refptr<chromeos::BluetoothSocket> socket_; 150 scoped_refptr<chromeos::BluetoothSocket> socket_;
151 #endif 151 #endif
152 }; 152 };
153 153
154 class BluetoothWriteFunction : public AsyncAPIFunction { 154 class BluetoothWriteFunction : public AsyncApiFunction {
155 public: 155 public:
156 DECLARE_EXTENSION_FUNCTION_NAME("experimental.bluetooth.write") 156 DECLARE_EXTENSION_FUNCTION_NAME("experimental.bluetooth.write")
157 BluetoothWriteFunction(); 157 BluetoothWriteFunction();
158 158
159 protected: 159 protected:
160 virtual ~BluetoothWriteFunction(); 160 virtual ~BluetoothWriteFunction();
161 161
162 // AsyncAPIFunction: 162 // AsyncApiFunction:
163 virtual bool Prepare() OVERRIDE; 163 virtual bool Prepare() OVERRIDE;
164 virtual bool Respond() OVERRIDE; 164 virtual bool Respond() OVERRIDE;
165 virtual void Work() OVERRIDE; 165 virtual void Work() OVERRIDE;
166 166
167 private: 167 private:
168 #if defined(OS_CHROMEOS) 168 #if defined(OS_CHROMEOS)
169 bool success_; 169 bool success_;
170 const base::BinaryValue* data_to_write_; // memory is owned by args_ 170 const base::BinaryValue* data_to_write_; // memory is owned by args_
171 scoped_refptr<chromeos::BluetoothSocket> socket_; 171 scoped_refptr<chromeos::BluetoothSocket> socket_;
172 #endif 172 #endif
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 private: 239 private:
240 void OnSuccessCallback(); 240 void OnSuccessCallback();
241 void OnErrorCallback(); 241 void OnErrorCallback();
242 #endif 242 #endif
243 }; 243 };
244 244
245 } // namespace api 245 } // namespace api
246 } // namespace extensions 246 } // namespace extensions
247 247
248 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_ 248 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/api_resource_manager.h ('k') | chrome/browser/extensions/api/serial/serial_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698