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

Unified Diff: chrome/browser/android/vr_shell/vr_shell.cc

Issue 2874623004: [vr] Introduce VrTabHelper (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
Index: chrome/browser/android/vr_shell/vr_shell.cc
diff --git a/chrome/browser/android/vr_shell/vr_shell.cc b/chrome/browser/android/vr_shell/vr_shell.cc
index 5d7b6bbb6ea9851693c9ed9fecc6710b1cadaaee..dd139d5aee3448b716fe35bac4c13405dda6fdb3 100644
--- a/chrome/browser/android/vr_shell/vr_shell.cc
+++ b/chrome/browser/android/vr_shell/vr_shell.cc
@@ -28,6 +28,7 @@
#include "chrome/browser/android/vr_shell/vr_input_manager.h"
#include "chrome/browser/android/vr_shell/vr_shell_delegate.h"
#include "chrome/browser/android/vr_shell/vr_shell_gl.h"
+#include "chrome/browser/android/vr_shell/vr_tab_helper.h"
#include "chrome/browser/android/vr_shell/vr_usage_monitor.h"
#include "chrome/browser/android/vr_shell/vr_web_contents_observer.h"
#include "content/public/browser/browser_thread.h"
@@ -62,8 +63,16 @@ namespace {
vr_shell::VrShell* g_instance;
void SetIsInVR(content::WebContents* contents, bool is_in_vr) {
- if (contents && contents->GetRenderWidgetHostView())
+ if (contents && contents->GetRenderWidgetHostView()) {
+ // TODO(asimjour) Contents should not be aware of VR mode. Instead, we
+ // should add a flag for disabling specific UI such as the keyboard (see
+ // VrTabHelper for details).
contents->GetRenderWidgetHostView()->SetIsInVR(is_in_vr);
+
+ VrTabHelper* vr_tab_helper = VrTabHelper::FromWebContents(contents);
+ DCHECK(vr_tab_helper);
+ vr_tab_helper->set_is_in_vr(is_in_vr);
+ }
}
void LoadControllerModelTask(

Powered by Google App Engine
This is Rietveld 408576698