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

Side by Side Diff: chrome/browser/usb/usb_chooser_controller.h

Issue 2352393006: Show "Paired" for already paired WebUSB devices on the chooser (Closed)
Patch Set: make WebUSBPermissionProvider::HasDevicePermission a static function Created 4 years, 2 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 | « no previous file | chrome/browser/usb/usb_chooser_controller.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 CHROME_BROWSER_USB_USB_CHOOSER_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_USB_USB_CHOOSER_CONTROLLER_H_
6 #define CHROME_BROWSER_USB_USB_CHOOSER_CONTROLLER_H_ 6 #define CHROME_BROWSER_USB_USB_CHOOSER_CONTROLLER_H_
7 7
8 #include <unordered_map> 8 #include <unordered_map>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 26 matching lines...) Expand all
37 mojo::Array<device::usb::DeviceFilterPtr> device_filters, 37 mojo::Array<device::usb::DeviceFilterPtr> device_filters,
38 content::RenderFrameHost* render_frame_host, 38 content::RenderFrameHost* render_frame_host,
39 const device::usb::ChooserService::GetPermissionCallback& callback); 39 const device::usb::ChooserService::GetPermissionCallback& callback);
40 ~UsbChooserController() override; 40 ~UsbChooserController() override;
41 41
42 // ChooserController: 42 // ChooserController:
43 base::string16 GetNoOptionsText() const override; 43 base::string16 GetNoOptionsText() const override;
44 base::string16 GetOkButtonLabel() const override; 44 base::string16 GetOkButtonLabel() const override;
45 size_t NumOptions() const override; 45 size_t NumOptions() const override;
46 base::string16 GetOption(size_t index) const override; 46 base::string16 GetOption(size_t index) const override;
47 bool IsPaired(size_t index) const override;
47 void RefreshOptions() override; 48 void RefreshOptions() override;
48 base::string16 GetStatus() const override; 49 base::string16 GetStatus() const override;
49 void Select(size_t index) override; 50 void Select(size_t index) override;
50 void Cancel() override; 51 void Cancel() override;
51 void Close() override; 52 void Close() override;
52 void OpenHelpCenterUrl() const override; 53 void OpenHelpCenterUrl() const override;
53 54
54 // device::UsbService::Observer: 55 // device::UsbService::Observer:
55 void OnDeviceAdded(scoped_refptr<device::UsbDevice> device) override; 56 void OnDeviceAdded(scoped_refptr<device::UsbDevice> device) override;
56 void OnDeviceRemoved(scoped_refptr<device::UsbDevice> device) override; 57 void OnDeviceRemoved(scoped_refptr<device::UsbDevice> device) override;
(...skipping 12 matching lines...) Expand all
69 std::vector<std::pair<scoped_refptr<device::UsbDevice>, base::string16>> 70 std::vector<std::pair<scoped_refptr<device::UsbDevice>, base::string16>>
70 devices_; 71 devices_;
71 // Maps from device name to number of devices. 72 // Maps from device name to number of devices.
72 std::unordered_map<base::string16, int> device_name_map_; 73 std::unordered_map<base::string16, int> device_name_map_;
73 base::WeakPtrFactory<UsbChooserController> weak_factory_; 74 base::WeakPtrFactory<UsbChooserController> weak_factory_;
74 75
75 DISALLOW_COPY_AND_ASSIGN(UsbChooserController); 76 DISALLOW_COPY_AND_ASSIGN(UsbChooserController);
76 }; 77 };
77 78
78 #endif // CHROME_BROWSER_USB_USB_CHOOSER_CONTROLLER_H_ 79 #endif // CHROME_BROWSER_USB_USB_CHOOSER_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/usb/usb_chooser_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698