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

Side by Side Diff: extensions/browser/api/hid/hid_api.h

Issue 660573007: Open HID connections asynchronously. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « device/hid/hid_service_win.cc ('k') | extensions/browser/api/hid/hid_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 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_HID_HID_API_H_ 5 #ifndef EXTENSIONS_BROWSER_API_HID_HID_API_H_
6 #define EXTENSIONS_BROWSER_API_HID_HID_API_H_ 6 #define EXTENSIONS_BROWSER_API_HID_HID_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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 HidConnectFunction(); 72 HidConnectFunction();
73 73
74 protected: 74 protected:
75 virtual bool Prepare() override; 75 virtual bool Prepare() override;
76 virtual void AsyncWorkStart() override; 76 virtual void AsyncWorkStart() override;
77 77
78 private: 78 private:
79 virtual ~HidConnectFunction(); 79 virtual ~HidConnectFunction();
80 80
81 void OnRequestAccessComplete(bool success); 81 void OnConnectComplete(scoped_refptr<device::HidConnection> connection);
82 82
83 scoped_ptr<core_api::hid::Connect::Params> parameters_; 83 scoped_ptr<core_api::hid::Connect::Params> parameters_;
84 device::HidDeviceInfo device_info_;
85 84
86 DISALLOW_COPY_AND_ASSIGN(HidConnectFunction); 85 DISALLOW_COPY_AND_ASSIGN(HidConnectFunction);
87 }; 86 };
88 87
89 class HidDisconnectFunction : public HidAsyncApiFunction { 88 class HidDisconnectFunction : public HidAsyncApiFunction {
90 public: 89 public:
91 DECLARE_EXTENSION_FUNCTION("hid.disconnect", HID_DISCONNECT); 90 DECLARE_EXTENSION_FUNCTION("hid.disconnect", HID_DISCONNECT);
92 91
93 HidDisconnectFunction(); 92 HidDisconnectFunction();
94 93
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 void OnFinished(bool success); 184 void OnFinished(bool success);
186 185
187 scoped_ptr<core_api::hid::SendFeatureReport::Params> parameters_; 186 scoped_ptr<core_api::hid::SendFeatureReport::Params> parameters_;
188 187
189 DISALLOW_COPY_AND_ASSIGN(HidSendFeatureReportFunction); 188 DISALLOW_COPY_AND_ASSIGN(HidSendFeatureReportFunction);
190 }; 189 };
191 190
192 } // namespace extensions 191 } // namespace extensions
193 192
194 #endif // EXTENSIONS_BROWSER_API_HID_HID_API_H_ 193 #endif // EXTENSIONS_BROWSER_API_HID_HID_API_H_
OLDNEW
« no previous file with comments | « device/hid/hid_service_win.cc ('k') | extensions/browser/api/hid/hid_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698