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

Unified Diff: chrome/browser/download/download_request_limiter.cc

Issue 2975593002: [vr] Deny permission requests in VR mode
Patch Set: . Created 3 years, 5 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
Index: chrome/browser/download/download_request_limiter.cc
diff --git a/chrome/browser/download/download_request_limiter.cc b/chrome/browser/download/download_request_limiter.cc
index ce379f77174df39fe5521891d3b984b4b16b0154..8206c8182a72f9e001e5a5bb0ccb6688ed7fc304 100644
--- a/chrome/browser/download/download_request_limiter.cc
+++ b/chrome/browser/download/download_request_limiter.cc
@@ -25,11 +25,17 @@
#include "content/public/browser/resource_dispatcher_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_delegate.h"
+#include "device/vr/features/features.h"
#include "url/gurl.h"
#if defined(OS_ANDROID)
#include "chrome/browser/download/download_request_infobar_delegate_android.h"
-#endif
+
+#if BUILDFLAG(ENABLE_VR)
+#include "chrome/browser/android/vr_shell/vr_tab_helper.h"
+#endif // BUILDFLAG(ENABLE_VR)
+
+#endif // defined(OS_ANDROID)
using content::BrowserThread;
using content::NavigationController;
@@ -208,6 +214,13 @@ void DownloadRequestLimiter::TabDownloadState::PromptUserForDownload(
if (is_showing_prompt())
return;
+#if BUILDFLAG(ENABLE_VR) && defined(OS_ANDROID)
+ if (vr_shell::VrTabHelper::IsInVr(web_contents_)) {
+ Cancel();
+ return;
+ }
+#endif
+
if (PermissionRequestManager::IsEnabled()) {
PermissionRequestManager* permission_request_manager =
PermissionRequestManager::FromWebContents(web_contents_);

Powered by Google App Engine
This is Rietveld 408576698