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

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

Issue 2904623002: Disable permissions dialog in VR (Closed)
Patch Set: CancelPermissionRequest is removed 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..86f5dc5e25d5f06e6f870574c53d24dd94aebfb4 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,13 @@ int PermissionManager::RequestPermissions(
content::WebContents* web_contents =
content::WebContents::FromRenderFrameHost(render_frame_host);
+
+#if BUILDFLAG(ENABLE_VR)
+ if (vr_shell::VrTabHelper::IsInVr(web_contents)) {
raymes 2017/05/31 23:10:07 This is missing: callback.Run(std::vector<Content
asimjour1 2017/06/06 17:58:56 Done.
+ return kNoPendingOperation;
+ }
+#endif // BUILDFLAG(ENABLE_VR)
+
GURL embedding_origin = web_contents->GetLastCommittedURL().GetOrigin();
int request_id = pending_requests_.Add(base::MakeUnique<PendingRequest>(

Powered by Google App Engine
This is Rietveld 408576698