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

Side by Side Diff: chrome/browser/android/vr_shell/ui_elements/ui_element.h

Issue 2840183003: VR: Route hover and click events to UI elements. (Closed)
Patch Set: Offer both OnButtonDown() and OnButtonUp(), rather than a combined OnClick() Created 3 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/android/vr_shell/ui_elements/ui_element.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 bool IsVisible() const; 97 bool IsVisible() const;
98 98
99 // Indicates whether the element should be tested for cursor input. 99 // Indicates whether the element should be tested for cursor input.
100 bool IsHitTestable() const; 100 bool IsHitTestable() const;
101 101
102 virtual void Render(VrShellRenderer* renderer, 102 virtual void Render(VrShellRenderer* renderer,
103 vr::Mat4f view_proj_matrix) const; 103 vr::Mat4f view_proj_matrix) const;
104 104
105 virtual void Initialize(); 105 virtual void Initialize();
106 106
107 // Controller interaction methods.
108 virtual void OnHoverEnter();
109 virtual void OnHoverLeave();
110 virtual void OnButtonDown();
111 virtual void OnButtonUp();
112
107 // Valid IDs are non-negative. 113 // Valid IDs are non-negative.
108 int id = -1; 114 int id = -1;
109 115
110 // Name string for debugging and testing purposes. 116 // Name string for debugging and testing purposes.
111 std::string name; 117 std::string name;
112 118
113 // If a non-negative parent ID is specified, applicable transformations 119 // If a non-negative parent ID is specified, applicable transformations
114 // are applied relative to the parent, rather than absolutely. 120 // are applied relative to the parent, rather than absolutely.
115 int parent_id = -1; 121 int parent_id = -1;
116 122
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 // A flag usable during transformation calculates to avoid duplicate work. 176 // A flag usable during transformation calculates to avoid duplicate work.
171 bool dirty; 177 bool dirty;
172 178
173 private: 179 private:
174 DISALLOW_COPY_AND_ASSIGN(UiElement); 180 DISALLOW_COPY_AND_ASSIGN(UiElement);
175 }; 181 };
176 182
177 } // namespace vr_shell 183 } // namespace vr_shell
178 184
179 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_UI_ELEMENT_H_ 185 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_UI_ELEMENT_H_
OLDNEW
« no previous file with comments | « no previous file | 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