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

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

Issue 2833773005: Pause drawing webvr when the App button is pressed (Closed)
Patch Set: refactor 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 12
13 namespace vr_shell { 13 namespace vr_shell {
14 14
15 struct UiElement; 15 struct UiElement;
16 class UiScene; 16 class UiScene;
17 class VrBrowserInterface;
17 18
18 class UiSceneManager { 19 class UiSceneManager {
19 public: 20 public:
20 explicit UiSceneManager(UiScene* scene); 21 UiSceneManager(
22 const base::WeakPtr<VrBrowserInterface>& weak_browser_interface_,
23 UiScene* scene);
21 ~UiSceneManager(); 24 ~UiSceneManager();
22 25
23 base::WeakPtr<UiSceneManager> GetWeakPtr(); 26 base::WeakPtr<UiSceneManager> GetWeakPtr();
24 27
25 void SetWebVRSecureOrigin(bool secure); 28 void SetWebVRSecureOrigin(bool secure);
26 void SetWebVRMode(bool web_vr); 29 void SetWebVRMode(bool web_vr);
27 30
31 void AppButtonPressed();
cjgrant 2017/05/02 18:07:06 How about OnAppButtonPressed or HandleAppButtonPre
ymalik 2017/05/02 20:28:39 Done.
32
28 private: 33 private:
29 void ConfigureSecurityWarnings(); 34 void ConfigureSecurityWarnings();
30 void OnSecurityWarningTimer(); 35 void OnSecurityWarningTimer();
31 void OnGLInitialized(); 36 void OnGLInitialized();
32 37
38 base::WeakPtr<VrBrowserInterface> weak_browser_interface_;
33 UiScene* scene_; 39 UiScene* scene_;
34 40
35 // UI element pointers (not owned by the scene manager). 41 // UI element pointers (not owned by the scene manager).
36 UiElement* permanent_security_warning_ = nullptr; 42 UiElement* permanent_security_warning_ = nullptr;
37 UiElement* transient_security_warning_ = nullptr; 43 UiElement* transient_security_warning_ = nullptr;
38 UiElement* main_content_ = nullptr; 44 UiElement* main_content_ = nullptr;
39 45
40 bool web_vr_mode_ = false; 46 bool web_vr_mode_ = false;
41 bool secure_origin_ = false; 47 bool secure_origin_ = false;
48 bool content_rendering_enabled_ = false;
42 49
43 base::OneShotTimer security_warning_timer_; 50 base::OneShotTimer security_warning_timer_;
44 51
45 base::WeakPtrFactory<UiSceneManager> weak_ptr_factory_; 52 base::WeakPtrFactory<UiSceneManager> weak_ptr_factory_;
46 53
47 DISALLOW_COPY_AND_ASSIGN(UiSceneManager); 54 DISALLOW_COPY_AND_ASSIGN(UiSceneManager);
48 }; 55 };
49 56
50 } // namespace vr_shell 57 } // namespace vr_shell
51 58
52 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_MANAGER_H_ 59 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_SCENE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698