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

Side by Side Diff: device/usb/device_manager_impl.h

Issue 1158323002: Revert of Build a basic Mojo service framework for device/usb (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/usb/device_impl_unittest.cc ('k') | device/usb/device_manager_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_MANAGER_IMPL_H_
6 #define DEVICE_USB_DEVICE_MANAGER_IMPL_H_
7
8 #include <vector>
9
10 #include "base/macros.h"
11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "base/memory/weak_ptr.h"
14 #include "device/usb/public/interfaces/device_manager.mojom.h"
15 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h"
16 #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h"
17
18 namespace device {
19
20 class UsbDevice;
21 class UsbDeviceFilter;
22
23 namespace usb {
24
25 class DeviceManagerDelegate;
26
27 // Implementation of the public DeviceManager interface. Clients in the browser
28 // can connect to this service via DeviceClient::ConnectToUSBDeviceManager.
29 class DeviceManagerImpl : public DeviceManager {
30 public:
31 DeviceManagerImpl(mojo::InterfaceRequest<DeviceManager> request,
32 scoped_ptr<DeviceManagerDelegate> delegate);
33 ~DeviceManagerImpl() override;
34
35 private:
36 // DeviceManager implementation:
37 void GetDevices(EnumerationOptionsPtr options,
38 const GetDevicesCallback& callback) override;
39
40 // Callback to handle the async response from the underlying UsbService.
41 void OnGetDevices(const GetDevicesCallback& callback,
42 const std::vector<UsbDeviceFilter>& filters,
43 const std::vector<scoped_refptr<UsbDevice>>& devices);
44
45 mojo::StrongBinding<DeviceManager> binding_;
46
47 scoped_ptr<DeviceManagerDelegate> delegate_;
48
49 base::WeakPtrFactory<DeviceManagerImpl> weak_factory_;
50
51 DISALLOW_COPY_AND_ASSIGN(DeviceManagerImpl);
52 };
53
54 } // namespace usb
55 } // namespace device
56
57 #endif // DEVICE_USB_DEVICE_MANAGER_IMPL_H_
OLDNEW
« no previous file with comments | « device/usb/device_impl_unittest.cc ('k') | device/usb/device_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698