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

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

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.h
diff --git a/chrome/browser/android/vr_shell/ui_elements/ui_element.h b/chrome/browser/android/vr_shell/ui_elements/ui_element.h
index b0f980772e4a5f8cd4393f9818c09e9921239a77..2d7aee23377b1f035dbd0dfe55cde61e221b2c05 100644
--- a/chrome/browser/android/vr_shell/ui_elements/ui_element.h
+++ b/chrome/browser/android/vr_shell/ui_elements/ui_element.h
@@ -110,11 +110,19 @@ class UiElement : public WorldRectangle {
virtual void Initialize();
// Controller interaction methods.
- virtual void OnHoverEnter(gfx::PointF position);
+ virtual void OnHoverEnter(const gfx::PointF& position);
virtual void OnHoverLeave();
- virtual void OnMove(gfx::PointF position);
- virtual void OnButtonDown(gfx::PointF position);
- virtual void OnButtonUp(gfx::PointF position);
+ virtual void OnMove(const gfx::PointF& position);
+ virtual void OnButtonDown(const gfx::PointF& position);
+ virtual void OnButtonUp(const gfx::PointF& position);
+ // Whether the point (relative to the origin of the element), should be
+ // considered on the element. All elements are considered rectangular by
+ // default though elements may override this function to handle arbitrary
+ // shapes. Points within the rectangular area are mapped from 0:1 as follows,
+ // though will extend outside this range when outside of the element:
+ // [(0.0, 0.0), (1.0, 0.0)
+ // (1.0, 0.0), (1.0, 1.0)]
+ virtual bool HitTest(const gfx::PointF& point) const;
int id() const { return id_; }
void set_id(int id) { id_ = id; }
« no previous file with comments | « chrome/browser/android/vr_shell/ui_elements/close_button.cc ('k') | chrome/browser/android/vr_shell/ui_elements/ui_element.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698