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

Unified Diff: chrome/browser/android/vr_shell/vr_tab_helper.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
« no previous file with comments | « no previous file | chrome/browser/permissions/permission_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/vr_tab_helper.cc
diff --git a/chrome/browser/android/vr_shell/vr_tab_helper.cc b/chrome/browser/android/vr_shell/vr_tab_helper.cc
index 3121cd2eedb0618ccae118ae20436b73c3856b7f..20372ea0b463d2a42180bf9bc4f8ddb9b584464c 100644
--- a/chrome/browser/android/vr_shell/vr_tab_helper.cc
+++ b/chrome/browser/android/vr_shell/vr_tab_helper.cc
@@ -36,6 +36,11 @@ void VrTabHelper::SetIsInVr(bool is_in_vr) {
/* static */
bool VrTabHelper::IsInVr(content::WebContents* contents) {
VrTabHelper* vr_tab_helper = VrTabHelper::FromWebContents(contents);
+ if (!vr_tab_helper) {
+ // This can only happen for unittests.
+ VrTabHelper::CreateForWebContents(contents);
+ vr_tab_helper = VrTabHelper::FromWebContents(contents);
+ }
return vr_tab_helper->is_in_vr();
}
« no previous file with comments | « no previous file | chrome/browser/permissions/permission_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698