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(const std::string& element_name); | |
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 // For testing whether the native state matches expectations | |
cjgrant
2017/03/30 14:48:35
- Needs a period (all comments need to be full sen
bsheedy
2017/03/30 21:05:14
Done.
| |
82 std::unique_ptr<base::DictionaryValue> CreateUiElementInfo( | |
83 std::string element_name); | |
cjgrant
2017/03/30 14:48:36
const std::string& here too. Could you scrub the
bsheedy
2017/03/30 21:05:14
Done, found one additional place where const ref c
| |
84 | |
79 private: | 85 private: |
80 void ApplyRecursiveTransforms(ContentRectangle* element); | 86 void ApplyRecursiveTransforms(ContentRectangle* element); |
81 void ApplyDictToElement(const base::DictionaryValue& dict, | 87 void ApplyDictToElement(const base::DictionaryValue& dict, |
82 ContentRectangle* element); | 88 ContentRectangle* element); |
83 | 89 |
84 std::vector<std::unique_ptr<ContentRectangle>> ui_elements_; | 90 std::vector<std::unique_ptr<ContentRectangle>> ui_elements_; |
85 ContentRectangle* content_element_ = nullptr; | 91 ContentRectangle* content_element_ = nullptr; |
86 Colorf background_color_ = {0.1f, 0.1f, 0.1f, 1.0f}; | 92 Colorf background_color_ = {0.1f, 0.1f, 0.1f, 1.0f}; |
87 float background_distance_ = 10.0f; | 93 float background_distance_ = 10.0f; |
88 bool webvr_rendering_enabled_ = true; | 94 bool webvr_rendering_enabled_ = true; |
89 | 95 |
90 DISALLOW_COPY_AND_ASSIGN(UiScene); | 96 DISALLOW_COPY_AND_ASSIGN(UiScene); |
91 }; | 97 }; |
92 | 98 |
93 } // namespace vr_shell | 99 } // namespace vr_shell |
94 | 100 |
95 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_H_ | 101 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_H_ |
OLD | NEW |