| 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_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_MANAGER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_MANAGER_H_ | 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/timer/timer.h" |
| 10 #include "base/values.h" | 11 #include "base/values.h" |
| 11 | 12 |
| 12 namespace vr_shell { | 13 namespace vr_shell { |
| 13 | 14 |
| 15 struct UiElement; |
| 14 class UiScene; | 16 class UiScene; |
| 15 | 17 |
| 16 class UiSceneManager { | 18 class UiSceneManager { |
| 17 public: | 19 public: |
| 18 explicit UiSceneManager(UiScene* scene); | 20 explicit UiSceneManager(UiScene* scene); |
| 19 ~UiSceneManager(); | 21 ~UiSceneManager(); |
| 20 | 22 |
| 21 base::WeakPtr<UiSceneManager> GetWeakPtr(); | 23 base::WeakPtr<UiSceneManager> GetWeakPtr(); |
| 22 | 24 |
| 23 void UpdateScene(std::unique_ptr<base::ListValue> commands); | 25 void UpdateScene(std::unique_ptr<base::ListValue> commands); |
| 24 | 26 |
| 25 void SetWebVRSecureOrigin(bool secure); | 27 void SetWebVRSecureOrigin(bool secure); |
| 26 void SetWebVRMode(bool web_vr); | 28 void SetWebVRMode(bool web_vr); |
| 27 | 29 |
| 28 private: | 30 private: |
| 31 void ConfigureSecurityWarnings(); |
| 32 void OnSecurityWarningTimer(); |
| 33 |
| 29 UiScene* scene_; | 34 UiScene* scene_; |
| 30 | 35 |
| 36 // UI elemenet pointers (not owned by the scene manager). |
| 37 UiElement* permanent_security_warning_ = nullptr; |
| 38 UiElement* transient_security_warning_ = nullptr; |
| 39 |
| 31 bool web_vr_mode_ = false; | 40 bool web_vr_mode_ = false; |
| 32 bool secure_origin_ = false; | 41 bool secure_origin_ = false; |
| 33 | 42 |
| 43 base::OneShotTimer security_warning_timer_; |
| 44 |
| 34 base::WeakPtrFactory<UiSceneManager> weak_ptr_factory_; | 45 base::WeakPtrFactory<UiSceneManager> weak_ptr_factory_; |
| 35 | 46 |
| 36 DISALLOW_COPY_AND_ASSIGN(UiSceneManager); | 47 DISALLOW_COPY_AND_ASSIGN(UiSceneManager); |
| 37 }; | 48 }; |
| 38 | 49 |
| 39 } // namespace vr_shell | 50 } // namespace vr_shell |
| 40 | 51 |
| 41 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_MANAGER_H_ | 52 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_MANAGER_H_ |
| OLD | NEW |