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

Unified Diff: chrome/browser/media/chrome_midi_permission_context.cc

Issue 122803002: Web MIDI: allow to show an infobar for permission requests from local files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 12 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/chrome_midi_permission_context.cc
diff --git a/chrome/browser/media/chrome_midi_permission_context.cc b/chrome/browser/media/chrome_midi_permission_context.cc
index ae55f9394b4cc3e48bf9ba085daa55818e0dcccc..7f727f80122a0d8499fcbc9dfb44113bfbcb8e5f 100644
--- a/chrome/browser/media/chrome_midi_permission_context.cc
+++ b/chrome/browser/media/chrome_midi_permission_context.cc
@@ -53,7 +53,11 @@ void ChromeMIDIPermissionContext::RequestMIDISysExPermission(
const PermissionRequestID id(render_process_id, render_view_id, bridge_id);
GURL embedder = web_contents->GetURL();
- if (!requesting_frame.is_valid() || !embedder.is_valid()) {
+ // |requesting_frame| can be empty and invalid when the frame is a local
+ // file. Here local files should be granted to show an infobar.
+ // Any user's action will not be stored to content settings data base.
+ if ((!requesting_frame.is_valid() && !requesting_frame.is_empty()) ||
+ !embedder.is_valid()) {
LOG(WARNING) << "Attempt to use MIDI sysex from an invalid URL: "
<< requesting_frame << "," << embedder
<< " (Web MIDI is not supported in popups)";
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698