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

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

Issue 2878083003: VR Shell: Allow UI elements to determine hit testing. (Closed)
Patch Set: Remove unrelated changes 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/ui_elements/ui_element.cc
diff --git a/chrome/browser/android/vr_shell/ui_elements/ui_element.cc b/chrome/browser/android/vr_shell/ui_elements/ui_element.cc
index 330416e9ba444bf95fd6f21c7a2db4d7fdd99ee3..d48861dc9d26ec7751525bcd71d25302f03b8238 100644
--- a/chrome/browser/android/vr_shell/ui_elements/ui_element.cc
+++ b/chrome/browser/android/vr_shell/ui_elements/ui_element.cc
@@ -116,15 +116,15 @@ void UiElement::Render(VrShellRenderer* renderer,
void UiElement::Initialize() {}
-void UiElement::OnHoverEnter(gfx::PointF position) {}
+void UiElement::OnHoverEnter(const gfx::PointF& position) {}
void UiElement::OnHoverLeave() {}
-void UiElement::OnMove(gfx::PointF position) {}
+void UiElement::OnMove(const gfx::PointF& position) {}
-void UiElement::OnButtonDown(gfx::PointF position) {}
+void UiElement::OnButtonDown(const gfx::PointF& position) {}
-void UiElement::OnButtonUp(gfx::PointF position) {}
+void UiElement::OnButtonUp(const gfx::PointF& position) {}
void UiElement::OnBeginFrame(const base::TimeTicks& begin_frame_time) {}
@@ -226,4 +226,9 @@ void UiElement::SetEnabled(bool enabled) {
visible_ = enabled;
}
+bool UiElement::HitTest(const gfx::PointF& point) const {
+ return point.x() >= 0.0f && point.x() <= 1.0f && point.y() >= 0.0f &&
+ point.y() <= 1.0f;
+}
+
} // namespace vr_shell
« no previous file with comments | « chrome/browser/android/vr_shell/ui_elements/ui_element.h ('k') | chrome/browser/android/vr_shell/ui_elements/url_bar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698