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

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

Issue 2821723002: Move classes in the device.usb Mojo namespace to device.mojom (Closed)
Patch Set: mcasas@ nits Created 3 years, 8 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/mojo/device_impl_unittest.cc ('k') | device/usb/mojo/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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 DEVICE_USB_MOJO_DEVICE_MANAGER_IMPL_H_ 5 #ifndef DEVICE_USB_MOJO_DEVICE_MANAGER_IMPL_H_
6 #define DEVICE_USB_MOJO_DEVICE_MANAGER_IMPL_H_ 6 #define DEVICE_USB_MOJO_DEVICE_MANAGER_IMPL_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <queue> 9 #include <queue>
10 #include <set> 10 #include <set>
(...skipping 10 matching lines...) Expand all
21 namespace device { 21 namespace device {
22 22
23 class UsbDevice; 23 class UsbDevice;
24 24
25 namespace usb { 25 namespace usb {
26 26
27 class PermissionProvider; 27 class PermissionProvider;
28 28
29 // Implementation of the public DeviceManager interface. This interface can be 29 // Implementation of the public DeviceManager interface. This interface can be
30 // requested from the devices app located at "devices", if available. 30 // requested from the devices app located at "devices", if available.
31 class DeviceManagerImpl : public DeviceManager, public UsbService::Observer { 31 class DeviceManagerImpl : public mojom::UsbDeviceManager,
32 public UsbService::Observer {
32 public: 33 public:
33 static void Create(base::WeakPtr<PermissionProvider> permission_provider, 34 static void Create(base::WeakPtr<PermissionProvider> permission_provider,
34 DeviceManagerRequest request); 35 mojom::UsbDeviceManagerRequest request);
35 36
36 ~DeviceManagerImpl() override; 37 ~DeviceManagerImpl() override;
37 38
38 private: 39 private:
39 DeviceManagerImpl(base::WeakPtr<PermissionProvider> permission_provider, 40 DeviceManagerImpl(base::WeakPtr<PermissionProvider> permission_provider,
40 UsbService* usb_service); 41 UsbService* usb_service);
41 42
42 // DeviceManager implementation: 43 // DeviceManager implementation:
43 void GetDevices(EnumerationOptionsPtr options, 44 void GetDevices(mojom::UsbEnumerationOptionsPtr options,
44 const GetDevicesCallback& callback) override; 45 const GetDevicesCallback& callback) override;
45 void GetDevice(const std::string& guid, 46 void GetDevice(const std::string& guid,
46 DeviceRequest device_request) override; 47 mojom::UsbDeviceRequest device_request) override;
47 void SetClient(DeviceManagerClientPtr client) override; 48 void SetClient(mojom::UsbDeviceManagerClientPtr client) override;
48 49
49 // Callbacks to handle the async responses from the underlying UsbService. 50 // Callbacks to handle the async responses from the underlying UsbService.
50 void OnGetDevices(EnumerationOptionsPtr options, 51 void OnGetDevices(mojom::UsbEnumerationOptionsPtr options,
51 const GetDevicesCallback& callback, 52 const GetDevicesCallback& callback,
52 const std::vector<scoped_refptr<UsbDevice>>& devices); 53 const std::vector<scoped_refptr<UsbDevice>>& devices);
53 54
54 // UsbService::Observer implementation: 55 // UsbService::Observer implementation:
55 void OnDeviceAdded(scoped_refptr<UsbDevice> device) override; 56 void OnDeviceAdded(scoped_refptr<UsbDevice> device) override;
56 void OnDeviceRemoved(scoped_refptr<UsbDevice> device) override; 57 void OnDeviceRemoved(scoped_refptr<UsbDevice> device) override;
57 void WillDestroyUsbService() override; 58 void WillDestroyUsbService() override;
58 59
59 void MaybeRunDeviceChangesCallback(); 60 void MaybeRunDeviceChangesCallback();
60 61
61 mojo::StrongBindingPtr<DeviceManager> binding_; 62 mojo::StrongBindingPtr<mojom::UsbDeviceManager> binding_;
62 base::WeakPtr<PermissionProvider> permission_provider_; 63 base::WeakPtr<PermissionProvider> permission_provider_;
63 64
64 UsbService* usb_service_; 65 UsbService* usb_service_;
65 ScopedObserver<UsbService, UsbService::Observer> observer_; 66 ScopedObserver<UsbService, UsbService::Observer> observer_;
66 DeviceManagerClientPtr client_; 67 mojom::UsbDeviceManagerClientPtr client_;
67 68
68 base::WeakPtrFactory<DeviceManagerImpl> weak_factory_; 69 base::WeakPtrFactory<DeviceManagerImpl> weak_factory_;
69 70
70 DISALLOW_COPY_AND_ASSIGN(DeviceManagerImpl); 71 DISALLOW_COPY_AND_ASSIGN(DeviceManagerImpl);
71 }; 72 };
72 73
73 } // namespace usb 74 } // namespace usb
74 } // namespace device 75 } // namespace device
75 76
76 #endif // DEVICE_USB_MOJO_DEVICE_MANAGER_IMPL_H_ 77 #endif // DEVICE_USB_MOJO_DEVICE_MANAGER_IMPL_H_
OLDNEW
« no previous file with comments | « device/usb/mojo/device_impl_unittest.cc ('k') | device/usb/mojo/device_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698