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

Unified Diff: chrome/browser/permissions/permission_manager.cc

Issue 2904623002: Disable permissions dialog in VR (Closed)
Patch Set: Add comment Created 3 years, 6 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/permissions/permission_manager.cc
diff --git a/chrome/browser/permissions/permission_manager.cc b/chrome/browser/permissions/permission_manager.cc
index bed2a61d7364ea0cbc3ff26275c73e31d4b4447d..979ccd73bc45ee7ed4eed1af1be4167b7e23a76e 100644
--- a/chrome/browser/permissions/permission_manager.cc
+++ b/chrome/browser/permissions/permission_manager.cc
@@ -31,8 +31,13 @@
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
+#include "device/vr/features/features.h"
#include "ppapi/features/features.h"
+#if BUILDFLAG(ENABLE_VR)
+#include "chrome/browser/android/vr_shell/vr_tab_helper.h"
+#endif // BUILDFLAG(ENABLE_VR)
+
#if BUILDFLAG(ENABLE_PLUGINS)
#include "chrome/browser/plugins/flash_permission_context.h"
#endif
@@ -282,6 +287,15 @@ int PermissionManager::RequestPermissions(
content::WebContents* web_contents =
content::WebContents::FromRenderFrameHost(render_frame_host);
+
+#if BUILDFLAG(ENABLE_VR)
+ if (vr_shell::VrTabHelper::IsInVr(web_contents)) {
+ callback.Run(
+ std::vector<ContentSetting>(permissions.size(), CONTENT_SETTING_BLOCK));
+ return kNoPendingOperation;
+ }
+#endif // BUILDFLAG(ENABLE_VR)
+
GURL embedding_origin = web_contents->GetLastCommittedURL().GetOrigin();
int request_id = pending_requests_.Add(base::MakeUnique<PendingRequest>(
« no previous file with comments | « chrome/browser/android/vr_shell/vr_tab_helper.cc ('k') | chrome/browser/permissions/permission_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698