Chromium Code Reviews| 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 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 737 } | 737 } |
| 738 hover_target_ = target; | 738 hover_target_ = target; |
| 739 return true; | 739 return true; |
| 740 } | 740 } |
| 741 | 741 |
| 742 void VrShellGl::SendHoverMove(const gfx::PointF& target_point, | 742 void VrShellGl::SendHoverMove(const gfx::PointF& target_point, |
| 743 const gfx::Point& local_point_pixels) { | 743 const gfx::Point& local_point_pixels) { |
| 744 if (!hover_target_) | 744 if (!hover_target_) |
| 745 return; | 745 return; |
| 746 if (hover_target_->fill() == Fill::CONTENT) { | 746 if (hover_target_->fill() == Fill::CONTENT) { |
| 747 // TODO(mthiesse, vollick): Content is currently way to sensitive to mouse | |
|
Ian Vollick
2017/06/15 15:09:57
nit: too.
| |
| 748 // moves for how noisy the controller is. It's almost impossible to click a | |
| 749 // link without unintentionally starting a drag event. For this reason we | |
| 750 // disable mouse moves, only delivering a down and up event. | |
| 751 if (in_click_) | |
| 752 return; | |
| 747 SendGestureToContent(MakeMouseEvent(blink::WebInputEvent::kMouseMove, | 753 SendGestureToContent(MakeMouseEvent(blink::WebInputEvent::kMouseMove, |
| 748 NowSeconds(), local_point_pixels, | 754 NowSeconds(), local_point_pixels, |
| 749 in_click_)); | 755 in_click_)); |
| 750 } else { | 756 } else { |
| 751 hover_target_->OnMove(target_point); | 757 hover_target_->OnMove(target_point); |
| 752 } | 758 } |
| 753 } | 759 } |
| 754 | 760 |
| 755 void VrShellGl::SendButtonDown(UiElement* target, | 761 void VrShellGl::SendButtonDown(UiElement* target, |
| 756 const gfx::PointF& target_point, | 762 const gfx::PointF& target_point, |
| (...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1622 // This assumes that the initial webvr_surface_size_ was set to the | 1628 // This assumes that the initial webvr_surface_size_ was set to the |
| 1623 // appropriate recommended render resolution as the default size during | 1629 // appropriate recommended render resolution as the default size during |
| 1624 // InitializeGl. Revisit if the initialization order changes. | 1630 // InitializeGl. Revisit if the initialization order changes. |
| 1625 device::mojom::VRDisplayInfoPtr info = | 1631 device::mojom::VRDisplayInfoPtr info = |
| 1626 device::GvrDelegate::CreateVRDisplayInfo(gvr_api_.get(), | 1632 device::GvrDelegate::CreateVRDisplayInfo(gvr_api_.get(), |
| 1627 webvr_surface_size_, device_id); | 1633 webvr_surface_size_, device_id); |
| 1628 browser_->RunVRDisplayInfoCallback(callback, &info); | 1634 browser_->RunVRDisplayInfoCallback(callback, &info); |
| 1629 } | 1635 } |
| 1630 | 1636 |
| 1631 } // namespace vr_shell | 1637 } // namespace vr_shell |
| OLD | NEW |