Don't show supervised user as "already on this device" while they're being imported.
[chromium-blink-merge.git] / device / hid / hid_connection_win.h
blobb1c4bf845ab532485a2cbdd0c0844c7c515f7fc2
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef DEVICE_HID_HID_CONNECTION_WIN_H_
6 #define DEVICE_HID_HID_CONNECTION_WIN_H_
8 #include <windows.h>
10 #include <set>
12 #include "base/win/scoped_handle.h"
13 #include "device/hid/hid_connection.h"
15 namespace device {
17 struct PendingHidTransfer;
19 class HidConnectionWin : public HidConnection {
20 public:
21 HidConnectionWin(scoped_refptr<HidDeviceInfo> device_info,
22 base::win::ScopedHandle file);
24 private:
25 friend class HidServiceWin;
26 friend struct PendingHidTransfer;
28 ~HidConnectionWin() override;
30 // HidConnection implementation.
31 void PlatformClose() override;
32 void PlatformRead(const ReadCallback& callback) override;
33 void PlatformWrite(scoped_refptr<net::IOBuffer> buffer,
34 size_t size,
35 const WriteCallback& callback) override;
36 void PlatformGetFeatureReport(uint8_t report_id,
37 const ReadCallback& callback) override;
38 void PlatformSendFeatureReport(scoped_refptr<net::IOBuffer> buffer,
39 size_t size,
40 const WriteCallback& callback) override;
42 void OnReadComplete(scoped_refptr<net::IOBuffer> buffer,
43 const ReadCallback& callback,
44 PendingHidTransfer* transfer,
45 bool signaled);
46 void OnReadFeatureComplete(scoped_refptr<net::IOBuffer> buffer,
47 const ReadCallback& callback,
48 PendingHidTransfer* transfer,
49 bool signaled);
50 void OnWriteComplete(const WriteCallback& callback,
51 PendingHidTransfer* transfer,
52 bool signaled);
54 base::win::ScopedHandle file_;
56 std::set<scoped_refptr<PendingHidTransfer> > transfers_;
58 DISALLOW_COPY_AND_ASSIGN(HidConnectionWin);
61 } // namespace device
63 #endif // DEVICE_HID_HID_CONNECTION_WIN_H_