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

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

Issue 1034333002: Check USB device path access when prompting users to select a device. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move MockPermissionBrokerClient into its own header. Created 5 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/usb_device_filter_unittest.cc ('k') | device/usb/usb_device_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 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 DEVICE_USB_USB_DEVICE_IMPL_H_ 5 #ifndef DEVICE_USB_USB_DEVICE_IMPL_H_
6 #define DEVICE_USB_USB_DEVICE_IMPL_H_ 6 #define DEVICE_USB_USB_DEVICE_IMPL_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 14 matching lines...) Expand all
25 class UsbDeviceHandleImpl; 25 class UsbDeviceHandleImpl;
26 class UsbContext; 26 class UsbContext;
27 27
28 typedef libusb_device* PlatformUsbDevice; 28 typedef libusb_device* PlatformUsbDevice;
29 typedef libusb_config_descriptor* PlatformUsbConfigDescriptor; 29 typedef libusb_config_descriptor* PlatformUsbConfigDescriptor;
30 30
31 class UsbDeviceImpl : public UsbDevice { 31 class UsbDeviceImpl : public UsbDevice {
32 public: 32 public:
33 // UsbDevice implementation: 33 // UsbDevice implementation:
34 #if defined(OS_CHROMEOS) 34 #if defined(OS_CHROMEOS)
35 void RequestUsbAccess( 35 // Only overridden on Chrome OS.
36 int interface_id, 36 void CheckUsbAccess(const ResultCallback& callback) override;
37 const base::Callback<void(bool success)>& callback) override; 37 void RequestUsbAccess(int interface_id,
38 const ResultCallback& callback) override;
38 #endif // OS_CHROMEOS 39 #endif // OS_CHROMEOS
39 scoped_refptr<UsbDeviceHandle> Open() override; 40 scoped_refptr<UsbDeviceHandle> Open() override;
40 bool Close(scoped_refptr<UsbDeviceHandle> handle) override; 41 bool Close(scoped_refptr<UsbDeviceHandle> handle) override;
41 const UsbConfigDescriptor* GetConfiguration() override; 42 const UsbConfigDescriptor* GetConfiguration() override;
42 bool GetManufacturer(base::string16* manufacturer) override; 43 bool GetManufacturer(base::string16* manufacturer) override;
43 bool GetProduct(base::string16* product) override; 44 bool GetProduct(base::string16* product) override;
44 bool GetSerialNumber(base::string16* serial_number) override; 45 bool GetSerialNumber(base::string16* serial_number) override;
45 46
46 protected: 47 protected:
47 friend class UsbServiceImpl; 48 friend class UsbServiceImpl;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 100
100 // Reference to the UI thread for permission-broker calls. 101 // Reference to the UI thread for permission-broker calls.
101 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; 102 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
102 103
103 DISALLOW_COPY_AND_ASSIGN(UsbDeviceImpl); 104 DISALLOW_COPY_AND_ASSIGN(UsbDeviceImpl);
104 }; 105 };
105 106
106 } // namespace device 107 } // namespace device
107 108
108 #endif // DEVICE_USB_USB_DEVICE_IMPL_H_ 109 #endif // DEVICE_USB_USB_DEVICE_IMPL_H_
OLDNEW
« no previous file with comments | « device/usb/usb_device_filter_unittest.cc ('k') | device/usb/usb_device_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698