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) { |