OLD | NEW |
---|---|
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_SCENE_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_H_ |
6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_H_ | 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | |
9 #include <vector> | 10 #include <vector> |
10 | 11 |
11 #include "base/macros.h" | 12 #include "base/macros.h" |
12 #include "chrome/browser/android/vr_shell/vr_math.h" | 13 #include "chrome/browser/android/vr_shell/vr_math.h" |
13 | 14 |
14 namespace base { | 15 namespace base { |
15 class DictionaryValue; | 16 class DictionaryValue; |
16 class ListValue; | 17 class ListValue; |
17 } | 18 } |
18 | 19 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
60 // unit used in animations. | 61 // unit used in animations. |
61 void UpdateTransforms(int64_t time_in_micro); | 62 void UpdateTransforms(int64_t time_in_micro); |
62 | 63 |
63 // Handle a batch of commands passed from the UI HTML. | 64 // Handle a batch of commands passed from the UI HTML. |
64 void HandleCommands(std::unique_ptr<base::ListValue> commands, | 65 void HandleCommands(std::unique_ptr<base::ListValue> commands, |
65 int64_t time_in_micro); | 66 int64_t time_in_micro); |
66 | 67 |
67 const std::vector<std::unique_ptr<ContentRectangle>>& GetUiElements() const; | 68 const std::vector<std::unique_ptr<ContentRectangle>>& GetUiElements() const; |
68 | 69 |
69 ContentRectangle* GetUiElementById(int element_id); | 70 ContentRectangle* GetUiElementById(int element_id); |
71 ContentRectangle* GetUiElementByName(std::string element_name); | |
cjgrant
2017/03/29 21:16:05
The parameter should be (const std::string& elemen
bsheedy
2017/03/29 22:33:44
Done.
| |
70 | 72 |
71 std::vector<const ContentRectangle*> GetWorldElements() const; | 73 std::vector<const ContentRectangle*> GetWorldElements() const; |
72 std::vector<const ContentRectangle*> GetHeadLockedElements() const; | 74 std::vector<const ContentRectangle*> GetHeadLockedElements() const; |
73 bool HasVisibleHeadLockedElements() const; | 75 bool HasVisibleHeadLockedElements() const; |
74 | 76 |
75 const Colorf& GetBackgroundColor() const; | 77 const Colorf& GetBackgroundColor() const; |
76 float GetBackgroundDistance() const; | 78 float GetBackgroundDistance() const; |
77 bool GetWebVrRenderingEnabled() const; | 79 bool GetWebVrRenderingEnabled() const; |
78 | 80 |
81 std::unique_ptr<base::DictionaryValue> CreateUiElementInfo( | |
cjgrant
2017/03/29 21:16:06
Please comment that this is for testing (or name t
bsheedy
2017/03/29 22:33:44
Done.
| |
82 std::string element_name); | |
83 | |
79 private: | 84 private: |
80 void ApplyRecursiveTransforms(ContentRectangle* element); | 85 void ApplyRecursiveTransforms(ContentRectangle* element); |
81 void ApplyDictToElement(const base::DictionaryValue& dict, | 86 void ApplyDictToElement(const base::DictionaryValue& dict, |
82 ContentRectangle* element); | 87 ContentRectangle* element); |
83 | 88 |
84 std::vector<std::unique_ptr<ContentRectangle>> ui_elements_; | 89 std::vector<std::unique_ptr<ContentRectangle>> ui_elements_; |
85 ContentRectangle* content_element_ = nullptr; | 90 ContentRectangle* content_element_ = nullptr; |
86 Colorf background_color_ = {0.1f, 0.1f, 0.1f, 1.0f}; | 91 Colorf background_color_ = {0.1f, 0.1f, 0.1f, 1.0f}; |
87 float background_distance_ = 10.0f; | 92 float background_distance_ = 10.0f; |
88 bool webvr_rendering_enabled_ = true; | 93 bool webvr_rendering_enabled_ = true; |
89 | 94 |
90 DISALLOW_COPY_AND_ASSIGN(UiScene); | 95 DISALLOW_COPY_AND_ASSIGN(UiScene); |
91 }; | 96 }; |
92 | 97 |
93 } // namespace vr_shell | 98 } // namespace vr_shell |
94 | 99 |
95 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_H_ | 100 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_H_ |
OLD | NEW |