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

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

Issue 2874623004: [vr] Introduce VrTabHelper (Closed)
Patch Set: nogncheck (thanks sadrul@, sky@)! 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 43b95b0ce5de448f49c9e60b293eb046865152b2..3dc6de3625012355811c2d5e4c9b83be05186352 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"
@@ -63,8 +64,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->SetIsInVr(is_in_vr);
+ }
}
void LoadControllerModelTask(
« no previous file with comments | « chrome/browser/android/tab_web_contents_delegate_android.cc ('k') | chrome/browser/android/vr_shell/vr_tab_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698