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

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

Issue 2879973002: Expose Gamepad API instance for Cardboard button (Closed)
Patch Set: rebase 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_gl.cc
diff --git a/chrome/browser/android/vr_shell/vr_shell_gl.cc b/chrome/browser/android/vr_shell/vr_shell_gl.cc
index d91f22a0d554d1514abbeef42500f35639faa0c7..1ebdc011ddf17fb7a7c9410d39dd443c50d5ba52 100644
--- a/chrome/browser/android/vr_shell/vr_shell_gl.cc
+++ b/chrome/browser/android/vr_shell/vr_shell_gl.cc
@@ -513,7 +513,9 @@ void VrShellGl::UpdateController(const gfx::Vector3dF& head_direction) {
controller_->UpdateState(head_direction);
pointer_start_ = controller_->GetPointerStart();
- browser_->UpdateGamepadData(controller_->GetGamepadData());
+ device::GvrGamepadData controller_data = controller_->GetGamepadData();
+ controller_data.is_screen_touching = currently_touched_;
+ browser_->UpdateGamepadData(controller_data);
}
void VrShellGl::HandleControllerInput(const gfx::Vector3dF& head_direction) {
@@ -1315,9 +1317,10 @@ void VrShellGl::DrawWebVr() {
vr_shell_renderer_->GetWebVrRenderer()->Draw(webvr_texture_id_);
}
-void VrShellGl::OnTriggerEvent() {
+void VrShellGl::OnTriggerEvent(bool touching) {
// Set a flag to handle this on the render thread at the next frame.
- touch_pending_ = true;
+ touch_pending_ = touch_pending_ || touching;
+ currently_touched_ = touching;
}
void VrShellGl::OnPause() {

Powered by Google App Engine
This is Rietveld 408576698