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

Unified Diff: chrome/browser/android/tab_web_contents_delegate_android.cc

Issue 2886163003: Use VrTabHelper to disable media permission and bluetooth picker (Closed)
Patch Set: 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 | « 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/android/tab_web_contents_delegate_android.cc
diff --git a/chrome/browser/android/tab_web_contents_delegate_android.cc b/chrome/browser/android/tab_web_contents_delegate_android.cc
index a010e88d2954b17d791f8998a99d6fc6f1344d05..3b2312ad5fadcf10e1f15244479ea9329ceee159 100644
--- a/chrome/browser/android/tab_web_contents_delegate_android.cc
+++ b/chrome/browser/android/tab_web_contents_delegate_android.cc
@@ -127,9 +127,8 @@ void TabWebContentsDelegateAndroid::RunFileChooser(
const FileChooserParams& params) {
#if BUILDFLAG(ENABLE_VR)
if (vr_shell::VrTabHelper::IsInVr(
- WebContents::FromRenderFrameHost(render_frame_host))) {
+ WebContents::FromRenderFrameHost(render_frame_host)))
return;
- }
#endif
FileSelectHelper::RunFileChooser(render_frame_host, params);
}
@@ -138,6 +137,10 @@ std::unique_ptr<BluetoothChooser>
TabWebContentsDelegateAndroid::RunBluetoothChooser(
content::RenderFrameHost* frame,
const BluetoothChooser::EventHandler& event_handler) {
+#if BUILDFLAG(ENABLE_VR)
+ if (vr_shell::VrTabHelper::IsInVr(WebContents::FromRenderFrameHost(frame)))
+ return nullptr;
+#endif
return base::MakeUnique<BluetoothChooserAndroid>(frame, event_handler);
}
@@ -279,6 +282,10 @@ void TabWebContentsDelegateAndroid::RequestMediaAccessPermission(
content::WebContents* web_contents,
const content::MediaStreamRequest& request,
const content::MediaResponseCallback& callback) {
+#if BUILDFLAG(ENABLE_VR)
+ if (vr_shell::VrTabHelper::IsInVr(web_contents))
+ return;
+#endif
MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest(
web_contents, request, callback, nullptr);
}
« 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