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

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

Issue 641203003: Read HID report descriptor from sysfs and request permission on connect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unnecessary code. 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_linux.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"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "extensions/browser/api/api_resource_manager.h" 12 #include "extensions/browser/api/api_resource_manager.h"
13 #include "extensions/browser/api/async_api_function.h" 13 #include "extensions/browser/api/async_api_function.h"
14 #include "extensions/browser/api/hid/hid_connection_resource.h" 14 #include "extensions/browser/api/hid/hid_connection_resource.h"
15 #include "extensions/browser/api/hid/hid_device_manager.h" 15 #include "extensions/browser/api/hid/hid_device_manager.h"
16 #include "extensions/common/api/hid.h" 16 #include "extensions/common/api/hid.h"
17 17
18 namespace device {
19 class HidService;
20 } // namespace device
21
18 namespace net { 22 namespace net {
19 class IOBuffer; 23 class IOBuffer;
20 } // namespace net 24 } // namespace net
21 25
22 namespace extensions { 26 namespace extensions {
23 27
24 class HidAsyncApiFunction : public AsyncApiFunction { 28 class HidAsyncApiFunction : public AsyncApiFunction {
25 public: 29 public:
26 HidAsyncApiFunction(); 30 HidAsyncApiFunction();
27 31
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 71
68 HidConnectFunction(); 72 HidConnectFunction();
69 73
70 protected: 74 protected:
71 virtual bool Prepare() override; 75 virtual bool Prepare() override;
72 virtual void AsyncWorkStart() override; 76 virtual void AsyncWorkStart() override;
73 77
74 private: 78 private:
75 virtual ~HidConnectFunction(); 79 virtual ~HidConnectFunction();
76 80
81 void OnRequestAccessComplete(bool success);
82
77 scoped_ptr<core_api::hid::Connect::Params> parameters_; 83 scoped_ptr<core_api::hid::Connect::Params> parameters_;
84 device::HidDeviceInfo device_info_;
78 85
79 DISALLOW_COPY_AND_ASSIGN(HidConnectFunction); 86 DISALLOW_COPY_AND_ASSIGN(HidConnectFunction);
80 }; 87 };
81 88
82 class HidDisconnectFunction : public HidAsyncApiFunction { 89 class HidDisconnectFunction : public HidAsyncApiFunction {
83 public: 90 public:
84 DECLARE_EXTENSION_FUNCTION("hid.disconnect", HID_DISCONNECT); 91 DECLARE_EXTENSION_FUNCTION("hid.disconnect", HID_DISCONNECT);
85 92
86 HidDisconnectFunction(); 93 HidDisconnectFunction();
87 94
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 void OnFinished(bool success); 185 void OnFinished(bool success);
179 186
180 scoped_ptr<core_api::hid::SendFeatureReport::Params> parameters_; 187 scoped_ptr<core_api::hid::SendFeatureReport::Params> parameters_;
181 188
182 DISALLOW_COPY_AND_ASSIGN(HidSendFeatureReportFunction); 189 DISALLOW_COPY_AND_ASSIGN(HidSendFeatureReportFunction);
183 }; 190 };
184 191
185 } // namespace extensions 192 } // namespace extensions
186 193
187 #endif // EXTENSIONS_BROWSER_API_HID_HID_API_H_ 194 #endif // EXTENSIONS_BROWSER_API_HID_HID_API_H_
OLDNEW
« no previous file with comments | « device/hid/hid_service_linux.cc ('k') | extensions/browser/api/hid/hid_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698