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

Unified Diff: chrome/browser/usb/usb_chooser_controller.cc

Issue 2352393006: Show "Paired" for already paired WebUSB devices on the chooser (Closed)
Patch Set: make WebUSBPermissionProvider::HasDevicePermission a static function Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/usb/usb_chooser_controller.h ('k') | chrome/browser/usb/web_usb_permission_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/usb/usb_chooser_controller.cc
diff --git a/chrome/browser/usb/usb_chooser_controller.cc b/chrome/browser/usb/usb_chooser_controller.cc
index 7b2c6d3ae2f20269cc9c09e6fc799cd35b9a1af4..59a6e166101c406ba5f0bef1552a6ccaee6134a3 100644
--- a/chrome/browser/usb/usb_chooser_controller.cc
+++ b/chrome/browser/usb/usb_chooser_controller.cc
@@ -17,6 +17,7 @@
#include "chrome/browser/usb/usb_chooser_context.h"
#include "chrome/browser/usb/usb_chooser_context_factory.h"
#include "chrome/browser/usb/web_usb_histograms.h"
+#include "chrome/browser/usb/web_usb_permission_provider.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/generated_resources.h"
@@ -97,6 +98,11 @@ base::string16 UsbChooserController::GetOption(size_t index) const {
devices_[index].first->serial_number());
}
+bool UsbChooserController::IsPaired(size_t index) const {
+ return WebUSBPermissionProvider::HasDevicePermission(render_frame_host_,
+ devices_[index].first);
+}
+
void UsbChooserController::RefreshOptions() {}
base::string16 UsbChooserController::GetStatus() const {
« no previous file with comments | « chrome/browser/usb/usb_chooser_controller.h ('k') | chrome/browser/usb/web_usb_permission_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698