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

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

Issue 2904623002: Disable permissions dialog in VR (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/permissions/permission_manager.cc
diff --git a/chrome/browser/permissions/permission_manager.cc b/chrome/browser/permissions/permission_manager.cc
index fc6917410fa8b7b57dda8401eea58a1e6ec818a7..3d2608eec16ac87a43dcc209d002c448aacc1dde 100644
--- a/chrome/browser/permissions/permission_manager.cc
+++ b/chrome/browser/permissions/permission_manager.cc
@@ -30,8 +30,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
@@ -308,6 +313,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;
+ }
+#endif // BUILDFLAG(ENABLE_VR)
raymes 2017/05/24 22:07:45 This will cancel all permission requests, even if
raymes 2017/05/24 22:13:43 I just noticed the related thread. I think the lac
asimjour1 2017/05/29 18:41:57 Unittest is added. Bluetooth chooser is disabled
+
const PermissionRequestID request(render_frame_host, request_id);
for (size_t i = 0; i < permissions.size(); ++i) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698