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

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

Issue 2815003005: Integrate WebUSB with Feature Policy (Closed)
Patch Set: Rebased Created 3 years, 7 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/usb_chooser_controller_unittest.cc » ('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 9a9cd36fb3c91199fd26c7579c10347b801456c9..9433805b19d79584b73360ac664bf956fc9e99ad 100644
--- a/chrome/browser/usb/usb_chooser_controller.cc
+++ b/chrome/browser/usb/usb_chooser_controller.cc
@@ -29,7 +29,6 @@
#include "device/usb/usb_device.h"
#include "device/usb/usb_device_filter.h"
#include "device/usb/usb_ids.h"
-#include "device/usb/webusb_descriptors.h"
#include "ui/base/l10n/l10n_util.h"
#include "url/gurl.h"
@@ -97,7 +96,6 @@ UsbChooserController::UsbChooserController(
RenderFrameHost* main_frame = web_contents->GetMainFrame();
requesting_origin_ = render_frame_host->GetLastCommittedURL().GetOrigin();
embedding_origin_ = main_frame->GetLastCommittedURL().GetOrigin();
- is_embedded_frame_ = render_frame_host != main_frame;
Profile* profile =
Profile::FromBrowserContext(web_contents->GetBrowserContext());
chooser_context_ =
@@ -140,8 +138,7 @@ bool UsbChooserController::IsPaired(size_t index) const {
return false;
return WebUSBPermissionProvider::HasDevicePermission(
- chooser_context_.get(), requesting_origin_, embedding_origin_,
- is_embedded_frame_, device);
+ chooser_context_.get(), requesting_origin_, embedding_origin_, device);
}
void UsbChooserController::RefreshOptions() {}
@@ -232,12 +229,5 @@ bool UsbChooserController::DisplayDevice(
if (UsbBlocklist::Get().IsExcluded(device))
return false;
- // Embedded frames must have their origin in the list provided by the device.
- if (is_embedded_frame_) {
- return device::FindInWebUsbAllowedOrigins(device->webusb_allowed_origins(),
- requesting_origin_, base::nullopt,
- base::nullopt);
- }
-
return true;
}
« no previous file with comments | « chrome/browser/usb/usb_chooser_controller.h ('k') | chrome/browser/usb/usb_chooser_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698