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

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

Issue 2903363002: VR: Split off UI code into a library to ease future unit testing. (Closed)
Patch Set: More tweaks. Created 3 years, 6 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>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "chrome/browser/android/vr_shell/color_scheme.h" 13 #include "chrome/browser/android/vr_shell/color_scheme.h"
14 #include "chrome/browser/android/vr_shell/ui_elements/ui_element_debug_id.h" 14 #include "chrome/browser/android/vr_shell/ui_elements/ui_element_debug_id.h"
15 #include "device/vr/vr_types.h" 15 #include "device/vr/vr_types.h"
16 #include "third_party/skia/include/core/SkColor.h" 16 #include "third_party/skia/include/core/SkColor.h"
17 17
18 namespace base { 18 namespace base {
19 class TimeTicks; 19 class TimeTicks;
20 } 20 }
21 21
22 namespace vr_shell { 22 namespace vr_shell {
23 23
24 class Animation; 24 class Animation;
25 class VrShellRenderer; 25 class UiElementRenderer;
26 26
27 enum XAnchoring { 27 enum XAnchoring {
28 XNONE = 0, 28 XNONE = 0,
29 XLEFT, 29 XLEFT,
30 XRIGHT, 30 XRIGHT,
31 }; 31 };
32 32
33 enum YAnchoring { 33 enum YAnchoring {
34 YNONE = 0, 34 YNONE = 0,
35 YTOP, 35 YTOP,
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 virtual void OnBeginFrame(const base::TimeTicks& begin_frame_time); 100 virtual void OnBeginFrame(const base::TimeTicks& begin_frame_time);
101 101
102 void Animate(const base::TimeTicks& time); 102 void Animate(const base::TimeTicks& time);
103 103
104 // Indicates whether the element should be visually rendered. 104 // Indicates whether the element should be visually rendered.
105 bool IsVisible() const; 105 bool IsVisible() const;
106 106
107 // Indicates whether the element should be tested for cursor input. 107 // Indicates whether the element should be tested for cursor input.
108 bool IsHitTestable() const; 108 bool IsHitTestable() const;
109 109
110 virtual void Render(VrShellRenderer* renderer, 110 virtual void Render(UiElementRenderer* renderer,
111 vr::Mat4f view_proj_matrix) const; 111 vr::Mat4f view_proj_matrix) const;
112 112
113 virtual void Initialize(); 113 virtual void Initialize();
114 114
115 // Controller interaction methods. 115 // Controller interaction methods.
116 virtual void OnHoverEnter(const gfx::PointF& position); 116 virtual void OnHoverEnter(const gfx::PointF& position);
117 virtual void OnHoverLeave(); 117 virtual void OnHoverLeave();
118 virtual void OnMove(const gfx::PointF& position); 118 virtual void OnMove(const gfx::PointF& position);
119 virtual void OnButtonDown(const gfx::PointF& position); 119 virtual void OnButtonDown(const gfx::PointF& position);
120 virtual void OnButtonUp(const gfx::PointF& position); 120 virtual void OnButtonUp(const gfx::PointF& position);
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 Transform transform_; 324 Transform transform_;
325 325
326 ColorScheme::Mode mode_ = ColorScheme::kModeNormal; 326 ColorScheme::Mode mode_ = ColorScheme::kModeNormal;
327 327
328 DISALLOW_COPY_AND_ASSIGN(UiElement); 328 DISALLOW_COPY_AND_ASSIGN(UiElement);
329 }; 329 };
330 330
331 } // namespace vr_shell 331 } // namespace vr_shell
332 332
333 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_UI_ELEMENT_H_ 333 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_UI_ELEMENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698