OLD | NEW |
| (Empty) |
1 // Copyright 2015 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. | |
4 | |
5 #ifndef DEVICE_USB_DEVICE_IMPL_H_ | |
6 #define DEVICE_USB_DEVICE_IMPL_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "base/memory/ref_counted.h" | |
10 #include "device/usb/public/interfaces/device.mojom.h" | |
11 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h" | |
12 #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h" | |
13 | |
14 namespace device { | |
15 | |
16 class UsbDevice; | |
17 | |
18 namespace usb { | |
19 | |
20 // Implementation of the public Device interface. Instances of this class are | |
21 // constructed by DeviceManagerImpl and are strongly bound to their MessagePipe | |
22 // lifetime. | |
23 class DeviceImpl : public Device { | |
24 public: | |
25 DeviceImpl(scoped_refptr<UsbDevice> device, | |
26 mojo::InterfaceRequest<Device> request); | |
27 ~DeviceImpl() override; | |
28 | |
29 private: | |
30 // Device implementation: | |
31 void GetDeviceInfo(const GetDeviceInfoCallback& callback) override; | |
32 | |
33 mojo::StrongBinding<Device> binding_; | |
34 | |
35 scoped_refptr<UsbDevice> device_; | |
36 DeviceInfoPtr info_; | |
37 | |
38 DISALLOW_COPY_AND_ASSIGN(DeviceImpl); | |
39 }; | |
40 | |
41 } // namespace usb | |
42 } // namespace device | |
43 | |
44 #endif // DEVICE_USB_DEVICE_IMPL_H_ | |
OLD | NEW |