| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/android/vr_shell/vr_shell_gl.h" | 5 #include "chrome/browser/android/vr_shell/vr_shell_gl.h" |
| 6 | 6 |
| 7 #include <chrono> | 7 #include <chrono> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 float gesture_xz_angle; | 637 float gesture_xz_angle; |
| 638 if (vr::XZAngle(controller_start_direction_, controller_direction, | 638 if (vr::XZAngle(controller_start_direction_, controller_direction, |
| 639 &gesture_xz_angle)) { | 639 &gesture_xz_angle)) { |
| 640 if (fabs(gesture_xz_angle) > kMinAppButtonGestureAngleRad) { | 640 if (fabs(gesture_xz_angle) > kMinAppButtonGestureAngleRad) { |
| 641 direction = | 641 direction = |
| 642 gesture_xz_angle < 0 ? UiInterface::LEFT : UiInterface::RIGHT; | 642 gesture_xz_angle < 0 ? UiInterface::LEFT : UiInterface::RIGHT; |
| 643 browser_->AppButtonGesturePerformed(direction); | 643 browser_->AppButtonGesturePerformed(direction); |
| 644 } | 644 } |
| 645 } | 645 } |
| 646 if (direction == UiInterface::NONE) | 646 if (direction == UiInterface::NONE) |
| 647 browser_->OnAppButtonClicked(); | 647 browser_->AppButtonClicked(); |
| 648 } | 648 } |
| 649 } | 649 } |
| 650 | 650 |
| 651 void VrShellGl::SendInputToContent(InputTarget input_target, | 651 void VrShellGl::SendInputToContent(InputTarget input_target, |
| 652 int pixel_x, | 652 int pixel_x, |
| 653 int pixel_y) { | 653 int pixel_y) { |
| 654 std::vector<std::unique_ptr<WebGestureEvent>> gesture_list = | 654 std::vector<std::unique_ptr<WebGestureEvent>> gesture_list = |
| 655 controller_->DetectGestures(); | 655 controller_->DetectGestures(); |
| 656 double timestamp = gesture_list.front()->TimeStampSeconds(); | 656 double timestamp = gesture_list.front()->TimeStampSeconds(); |
| 657 | 657 |
| (...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1337 // This assumes that the initial webvr_surface_size_ was set to the | 1337 // This assumes that the initial webvr_surface_size_ was set to the |
| 1338 // appropriate recommended render resolution as the default size during | 1338 // appropriate recommended render resolution as the default size during |
| 1339 // InitializeGl. Revisit if the initialization order changes. | 1339 // InitializeGl. Revisit if the initialization order changes. |
| 1340 device::mojom::VRDisplayInfoPtr info = | 1340 device::mojom::VRDisplayInfoPtr info = |
| 1341 device::GvrDelegate::CreateVRDisplayInfo(gvr_api_.get(), | 1341 device::GvrDelegate::CreateVRDisplayInfo(gvr_api_.get(), |
| 1342 webvr_surface_size_, device_id); | 1342 webvr_surface_size_, device_id); |
| 1343 browser_->RunVRDisplayInfoCallback(callback, &info); | 1343 browser_->RunVRDisplayInfoCallback(callback, &info); |
| 1344 } | 1344 } |
| 1345 | 1345 |
| 1346 } // namespace vr_shell | 1346 } // namespace vr_shell |
| OLD | NEW |