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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
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 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_UI_ELEMENT_H_ 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_UI_ELEMENT_H_
6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_UI_ELEMENT_H_ 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_UI_ELEMENT_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 vr::Mat4f view_proj_matrix) const; 108 vr::Mat4f view_proj_matrix) const;
109 109
110 virtual void Initialize(); 110 virtual void Initialize();
111 111
112 // Controller interaction methods. 112 // Controller interaction methods.
113 virtual void OnHoverEnter(gfx::PointF position); 113 virtual void OnHoverEnter(gfx::PointF position);
114 virtual void OnHoverLeave(); 114 virtual void OnHoverLeave();
115 virtual void OnMove(gfx::PointF position); 115 virtual void OnMove(gfx::PointF position);
116 virtual void OnButtonDown(gfx::PointF position); 116 virtual void OnButtonDown(gfx::PointF position);
117 virtual void OnButtonUp(gfx::PointF position); 117 virtual void OnButtonUp(gfx::PointF position);
118 // Whether the point (relative to the origin of the element), should be
cjgrant 2017/05/15 16:55:09 - Typo at "by considered". - What does "local" mea
mthiesse 2017/05/15 21:11:27 What typo? Clarified the comment and got rid of t
cjgrant 2017/05/15 21:51:52 "All elements are by considered rectangular by def
mthiesse 2017/05/15 22:23:32 I do not see the the problem. fixed ;)
119 // considered on the element. All elements are by considered rectangular by
120 // default. Local points are mapped as follows, though will extend outside the
121 // rectangular bounds of the element:
122 // [(0.0, 0.0), (1.0, 0.0)
123 // (1.0, 0.0), (1.0, 1.0)]
124 virtual bool HitTest(gfx::PointF point) const;
118 125
119 int id() const { return id_; } 126 int id() const { return id_; }
120 void set_id(int id) { id_ = id; } 127 void set_id(int id) { id_ = id; }
121 128
122 // If a non-negative parent ID is specified, applicable transformations 129 // If a non-negative parent ID is specified, applicable transformations
123 // are applied relative to the parent, rather than absolutely. 130 // are applied relative to the parent, rather than absolutely.
124 int parent_id() const { return parent_id_; } 131 int parent_id() const { return parent_id_; }
125 void set_parent_id(int id) { parent_id_ = id; } 132 void set_parent_id(int id) { parent_id_ = id; }
126 133
127 // If true, this object will be visible. 134 // If true, this object will be visible.
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 bool dirty_ = false; 299 bool dirty_ = false;
293 300
294 Transform transform_; 301 Transform transform_;
295 302
296 DISALLOW_COPY_AND_ASSIGN(UiElement); 303 DISALLOW_COPY_AND_ASSIGN(UiElement);
297 }; 304 };
298 305
299 } // namespace vr_shell 306 } // namespace vr_shell
300 307
301 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_UI_ELEMENT_H_ 308 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_UI_ELEMENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698