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

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

Issue 2904623002: Disable permissions dialog in VR (Closed)
Patch Set: Address comments 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
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..783fe274a6cc294502bbd2554412859db8ae4e10 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
@@ -287,6 +292,13 @@ int PermissionManager::RequestPermissions(
int request_id = pending_requests_.Add(base::MakeUnique<PendingRequest>(
render_frame_host, permissions, callback));
+#if BUILDFLAG(ENABLE_VR)
+ if (vr_shell::VrTabHelper::IsInVr(web_contents)) {
+ CancelPermissionRequest(request_id);
+ return kNoPendingOperation;
+ }
raymes 2017/05/31 00:56:00 nit: you can just do this before we create the Pen
asimjour1 2017/05/31 15:06:11 Done. I moved it to line 289 (web_contents is need
+#endif // BUILDFLAG(ENABLE_VR)
+
const PermissionRequestID request(render_frame_host, request_id);
for (size_t i = 0; i < permissions.size(); ++i) {

Powered by Google App Engine
This is Rietveld 408576698