| 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 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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |