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

Unified Diff: chrome/browser/chrome_quota_permission_context.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/chrome_quota_permission_context.cc
diff --git a/chrome/browser/chrome_quota_permission_context.cc b/chrome/browser/chrome_quota_permission_context.cc
index b4921431e12595e294d3105bb2d020f0d1e9d2cd..6f39a9b796c89fe8f5a168bdb400a28bc86107c3 100644
--- a/chrome/browser/chrome_quota_permission_context.cc
+++ b/chrome/browser/chrome_quota_permission_context.cc
@@ -21,6 +21,7 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/web_contents.h"
+#include "device/vr/features/features.h"
#include "storage/common/quota/quota_types.h"
#include "ui/base/l10n/l10n_util.h"
#include "url/gurl.h"
@@ -30,9 +31,14 @@
#include "chrome/browser/infobars/infobar_service.h"
#include "components/infobars/core/confirm_infobar_delegate.h"
#include "components/infobars/core/infobar.h"
+
+#if BUILDFLAG(ENABLE_VR)
+#include "chrome/browser/android/vr_shell/vr_tab_helper.h"
+#endif // BUILDFLAG(ENABLE_VR)
+
#else
#include "ui/vector_icons/vector_icons.h"
-#endif
+#endif // defined(OS_ANDROID)
namespace {
@@ -282,6 +288,15 @@ void ChromeQuotaPermissionContext::RequestQuotaPermission(
return;
}
+#if BUILDFLAG(ENABLE_VR) && defined(OS_ANDROID)
+ if (vr_shell::VrTabHelper::IsInVr(web_contents)) {
+ LOG(WARNING) << "Attempt to request quota from VR: "
+ << render_process_id << "," << params.render_frame_id;
+ DispatchCallbackOnIOThread(callback, QUOTA_PERMISSION_RESPONSE_CANCELLED);
+ return;
+ }
+#endif
+
if (PermissionRequestManager::IsEnabled()) {
PermissionRequestManager* permission_request_manager =
PermissionRequestManager::FromWebContents(web_contents);
« no previous file with comments | « chrome/browser/android/vr_shell/vr_tab_helper.cc ('k') | chrome/browser/download/download_request_limiter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698