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

Side by Side Diff: chrome/browser/android/vr_shell/ui_scene_manager.h

Issue 2866853002: VR: Wire VrShell UI-related state to the scene manager. (Closed)
Patch Set: Refactoring for cleanup and to address comments. Created 3 years, 7 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_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/timer/timer.h"
11 #include "base/values.h" 11 #include "base/values.h"
12 #include "url/gurl.h" 12 #include "chrome/browser/android/vr_shell/ui_interface.h"
13
14 class GURL;
13 15
14 namespace vr_shell { 16 namespace vr_shell {
15 17
16 class UiElement; 18 class UiElement;
17 class UiScene; 19 class UiScene;
18 class UrlBar; 20 class UrlBar;
19 class VrBrowserInterface; 21 class VrBrowserInterface;
20 22
21 class UiSceneManager { 23 class UiSceneManager {
22 public: 24 public:
23 UiSceneManager(VrBrowserInterface* browser, UiScene* scene, bool in_cct); 25 UiSceneManager(VrBrowserInterface* browser,
26 UiScene* scene,
27 bool in_cct,
28 bool in_web_vr);
24 ~UiSceneManager(); 29 ~UiSceneManager();
25 30
26 base::WeakPtr<UiSceneManager> GetWeakPtr(); 31 base::WeakPtr<UiSceneManager> GetWeakPtr();
27 32
28 void SetWebVRSecureOrigin(bool secure); 33 void SetWebVrSecureOrigin(bool secure);
29 void SetWebVRMode(bool web_vr); 34 void SetWebVrMode(bool web_vr);
35 void SetURL(const GURL& gurl);
36 // These methods are currently stubbed.
37 void SetFullscreen(bool enabled);
38 void SetSecurityLevel(int level);
39 void SetLoading(bool loading);
40 void SetLoadProgress(double progress);
41 void SetHistoryButtonsEnabled(bool can_go_back, bool can_go_forward);
30 42
31 void OnAppButtonClicked(); 43 void OnAppButtonClicked();
32 void OnUrlChange(const GURL& gurl); 44 void OnAppButtonGesturePerformed(UiInterface::Direction direction);
33 45
34 private: 46 private:
35 void CreateSecurityWarnings(); 47 void CreateSecurityWarnings();
36 void CreateContentQuad(); 48 void CreateContentQuad();
37 void CreateBackground(); 49 void CreateBackground();
38 void CreateUrlBar(); 50 void CreateUrlBar();
39 51
40 void ConfigureSecurityWarnings(); 52 void ConfigureSecurityWarnings();
41 void OnSecurityWarningTimer(); 53 void OnSecurityWarningTimer();
42 int AllocateId(); 54 int AllocateId();
43 55
44 VrBrowserInterface* browser_; 56 VrBrowserInterface* browser_;
45 UiScene* scene_; 57 UiScene* scene_;
46 58
47 // UI element pointers (not owned by the scene manager). 59 // UI element pointers (not owned by the scene manager).
48 UiElement* permanent_security_warning_ = nullptr; 60 UiElement* permanent_security_warning_ = nullptr;
49 UiElement* transient_security_warning_ = nullptr; 61 UiElement* transient_security_warning_ = nullptr;
50 UiElement* main_content_ = nullptr; 62 UiElement* main_content_ = nullptr;
51 UrlBar* url_bar_ = nullptr; 63 UrlBar* url_bar_ = nullptr;
52 64
53 bool web_vr_mode_ = false; 65 bool in_cct_;
66 bool web_vr_mode_;
54 bool secure_origin_ = false; 67 bool secure_origin_ = false;
55 bool content_rendering_enabled_ = true; 68 bool content_rendering_enabled_ = true;
56 bool in_cct_;
57 69
58 int next_available_id_ = 1; 70 int next_available_id_ = 1;
59 71
60 std::vector<UiElement*> browser_ui_elements_; 72 std::vector<UiElement*> browser_ui_elements_;
61 73
62 base::OneShotTimer security_warning_timer_; 74 base::OneShotTimer security_warning_timer_;
63 75
64 base::WeakPtrFactory<UiSceneManager> weak_ptr_factory_; 76 base::WeakPtrFactory<UiSceneManager> weak_ptr_factory_;
65 77
66 DISALLOW_COPY_AND_ASSIGN(UiSceneManager); 78 DISALLOW_COPY_AND_ASSIGN(UiSceneManager);
67 }; 79 };
68 80
69 } // namespace vr_shell 81 } // namespace vr_shell
70 82
71 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_MANAGER_H_ 83 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698