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

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

Issue 177113013: Bluetooth: add Device events, and cleanup JS API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@arman-patch
Patch Set: I suck at rebase Created 6 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/bluetooth/bluetooth_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 virtual ~BluetoothGetAdapterStateFunction() {} 121 virtual ~BluetoothGetAdapterStateFunction() {}
122 122
123 // BluetoothExtensionFunction: 123 // BluetoothExtensionFunction:
124 virtual bool DoWork(scoped_refptr<device::BluetoothAdapter> adapter) OVERRIDE; 124 virtual bool DoWork(scoped_refptr<device::BluetoothAdapter> adapter) OVERRIDE;
125 }; 125 };
126 126
127 class BluetoothGetDevicesFunction : public BluetoothExtensionFunction { 127 class BluetoothGetDevicesFunction : public BluetoothExtensionFunction {
128 public: 128 public:
129 DECLARE_EXTENSION_FUNCTION("bluetooth.getDevices", BLUETOOTH_GETDEVICES) 129 DECLARE_EXTENSION_FUNCTION("bluetooth.getDevices", BLUETOOTH_GETDEVICES)
130 130
131 BluetoothGetDevicesFunction();
132
133 protected: 131 protected:
134 virtual ~BluetoothGetDevicesFunction() {} 132 virtual ~BluetoothGetDevicesFunction() {}
135 133
136 // BluetoothExtensionFunction: 134 // BluetoothExtensionFunction:
137 virtual bool DoWork(scoped_refptr<device::BluetoothAdapter> adapter) OVERRIDE; 135 virtual bool DoWork(scoped_refptr<device::BluetoothAdapter> adapter) OVERRIDE;
138
139 private:
140 void DispatchDeviceSearchResult(const device::BluetoothDevice& device);
141 void FinishDeviceSearch();
142
143 int device_events_sent_;
144 }; 136 };
145 137
146 class BluetoothGetServicesFunction : public BluetoothExtensionFunction { 138 class BluetoothGetServicesFunction : public BluetoothExtensionFunction {
147 public: 139 public:
148 DECLARE_EXTENSION_FUNCTION("bluetooth.getServices", BLUETOOTH_GETSERVICES) 140 DECLARE_EXTENSION_FUNCTION("bluetooth.getServices", BLUETOOTH_GETSERVICES)
149 141
150 protected: 142 protected:
151 virtual ~BluetoothGetServicesFunction() {} 143 virtual ~BluetoothGetServicesFunction() {}
152 144
153 // BluetoothExtensionFunction: 145 // BluetoothExtensionFunction:
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 276
285 private: 277 private:
286 void OnSuccessCallback(); 278 void OnSuccessCallback();
287 void OnErrorCallback(); 279 void OnErrorCallback();
288 }; 280 };
289 281
290 } // namespace api 282 } // namespace api
291 } // namespace extensions 283 } // namespace extensions
292 284
293 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_ 285 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/bluetooth/bluetooth_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698