| 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 <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.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 "third_party/skia/include/core/SkColor.h" | 15 #include "third_party/skia/include/core/SkColor.h" |
| 16 | 16 |
| 17 namespace base { | 17 namespace base { |
| 18 class ListValue; | 18 class ListValue; |
| 19 class TimeTicks; | 19 class TimeTicks; |
| 20 } | 20 } // namespace base |
| 21 |
| 22 namespace cc { |
| 23 class Animation; |
| 24 } // namespace cc |
| 21 | 25 |
| 22 namespace vr_shell { | 26 namespace vr_shell { |
| 23 | 27 |
| 24 class Animation; | |
| 25 class UiElement; | 28 class UiElement; |
| 26 | 29 |
| 27 class UiScene { | 30 class UiScene { |
| 28 public: | 31 public: |
| 29 enum Command { | 32 enum Command { |
| 30 ADD_ELEMENT, | 33 ADD_ELEMENT, |
| 31 UPDATE_ELEMENT, | 34 UPDATE_ELEMENT, |
| 32 REMOVE_ELEMENT, | 35 REMOVE_ELEMENT, |
| 33 ADD_ANIMATION, | 36 ADD_ANIMATION, |
| 34 REMOVE_ANIMATION, | 37 REMOVE_ANIMATION, |
| 35 CONFIGURE_SCENE, | 38 CONFIGURE_SCENE, |
| 36 }; | 39 }; |
| 37 | 40 |
| 38 UiScene(); | 41 UiScene(); |
| 39 virtual ~UiScene(); | 42 virtual ~UiScene(); |
| 40 | 43 |
| 41 void AddUiElement(std::unique_ptr<UiElement> element); | 44 void AddUiElement(std::unique_ptr<UiElement> element); |
| 42 | 45 |
| 43 void RemoveUiElement(int element_id); | 46 void RemoveUiElement(int element_id); |
| 44 | 47 |
| 45 // Add an animation to the scene, on element |element_id|. | 48 // Add an animation to the scene, on element |element_id|. |
| 46 void AddAnimation(int element_id, std::unique_ptr<Animation> animation); | 49 void AddAnimation(int element_id, std::unique_ptr<cc::Animation> animation); |
| 47 | 50 |
| 48 // Remove |animation_id| from element |element_id|. | 51 // Remove |animation_id| from element |element_id|. |
| 49 void RemoveAnimation(int element_id, int animation_id); | 52 void RemoveAnimation(int element_id, int animation_id); |
| 50 | 53 |
| 51 // Handles per-frame updates, giving each element the opportunity to update, | 54 // Handles per-frame updates, giving each element the opportunity to update, |
| 52 // if necessary (eg, for animations). NB: |current_time| is the shared, | 55 // if necessary (eg, for animations). NB: |current_time| is the shared, |
| 53 // absolute begin frame time. | 56 // absolute begin frame time. |
| 54 void OnBeginFrame(const base::TimeTicks& current_time); | 57 void OnBeginFrame(const base::TimeTicks& current_time); |
| 55 | 58 |
| 56 // Handle a batch of commands passed from the UI HTML. | 59 // Handle a batch of commands passed from the UI HTML. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 bool is_exiting_ = false; | 104 bool is_exiting_ = false; |
| 102 bool is_prompting_to_exit_ = false; | 105 bool is_prompting_to_exit_ = false; |
| 103 bool showing_splash_screen_ = false; | 106 bool showing_splash_screen_ = false; |
| 104 | 107 |
| 105 DISALLOW_COPY_AND_ASSIGN(UiScene); | 108 DISALLOW_COPY_AND_ASSIGN(UiScene); |
| 106 }; | 109 }; |
| 107 | 110 |
| 108 } // namespace vr_shell | 111 } // namespace vr_shell |
| 109 | 112 |
| 110 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_H_ | 113 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_H_ |
| OLD | NEW |