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

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

Issue 2929483003: VR: Further split common code from Android-specific code. (Closed)
Patch Set: Created 3 years, 6 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #include "chrome/browser/android/vr_shell/ui_scene_manager.h" 5 #include "chrome/browser/android/vr_shell/ui_scene_manager.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "chrome/browser/android/vr_shell/textures/close_button_texture.h" 9 #include "chrome/browser/android/vr_shell/textures/close_button_texture.h"
10 #include "chrome/browser/android/vr_shell/textures/ui_texture.h" 10 #include "chrome/browser/android/vr_shell/textures/ui_texture.h"
11 #include "chrome/browser/android/vr_shell/ui_browser_interface.h"
11 #include "chrome/browser/android/vr_shell/ui_elements/audio_capture_indicator.h" 12 #include "chrome/browser/android/vr_shell/ui_elements/audio_capture_indicator.h"
12 #include "chrome/browser/android/vr_shell/ui_elements/button.h" 13 #include "chrome/browser/android/vr_shell/ui_elements/button.h"
13 #include "chrome/browser/android/vr_shell/ui_elements/exit_warning.h" 14 #include "chrome/browser/android/vr_shell/ui_elements/exit_warning.h"
14 #include "chrome/browser/android/vr_shell/ui_elements/loading_indicator.h" 15 #include "chrome/browser/android/vr_shell/ui_elements/loading_indicator.h"
15 #include "chrome/browser/android/vr_shell/ui_elements/permanent_security_warning .h" 16 #include "chrome/browser/android/vr_shell/ui_elements/permanent_security_warning .h"
16 #include "chrome/browser/android/vr_shell/ui_elements/screen_capture_indicator.h " 17 #include "chrome/browser/android/vr_shell/ui_elements/screen_capture_indicator.h "
17 #include "chrome/browser/android/vr_shell/ui_elements/screen_dimmer.h" 18 #include "chrome/browser/android/vr_shell/ui_elements/screen_dimmer.h"
18 #include "chrome/browser/android/vr_shell/ui_elements/transient_security_warning .h" 19 #include "chrome/browser/android/vr_shell/ui_elements/transient_security_warning .h"
19 #include "chrome/browser/android/vr_shell/ui_elements/ui_element.h" 20 #include "chrome/browser/android/vr_shell/ui_elements/ui_element.h"
20 #include "chrome/browser/android/vr_shell/ui_elements/ui_element_debug_id.h" 21 #include "chrome/browser/android/vr_shell/ui_elements/ui_element_debug_id.h"
21 #include "chrome/browser/android/vr_shell/ui_elements/url_bar.h" 22 #include "chrome/browser/android/vr_shell/ui_elements/url_bar.h"
22 #include "chrome/browser/android/vr_shell/ui_elements/video_capture_indicator.h" 23 #include "chrome/browser/android/vr_shell/ui_elements/video_capture_indicator.h"
23 #include "chrome/browser/android/vr_shell/ui_scene.h" 24 #include "chrome/browser/android/vr_shell/ui_scene.h"
24 #include "chrome/browser/android/vr_shell/vr_browser_interface.h"
25 25
26 namespace vr_shell { 26 namespace vr_shell {
27 27
28 namespace { 28 namespace {
29 29
30 static constexpr int kWarningTimeoutSeconds = 30; 30 static constexpr int kWarningTimeoutSeconds = 30;
31 static constexpr float kWarningDistance = 0.7; 31 static constexpr float kWarningDistance = 0.7;
32 static constexpr float kWarningAngleRadians = 16.3 * M_PI / 180.0; 32 static constexpr float kWarningAngleRadians = 16.3 * M_PI / 180.0;
33 static constexpr float kPermanentWarningHeight = 0.070f; 33 static constexpr float kPermanentWarningHeight = 0.070f;
34 static constexpr float kPermanentWarningWidth = 0.224f; 34 static constexpr float kPermanentWarningWidth = 0.224f;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 static constexpr float kFullscreenDistance = 3; 68 static constexpr float kFullscreenDistance = 3;
69 static constexpr float kFullscreenHeight = 0.64 * kFullscreenDistance; 69 static constexpr float kFullscreenHeight = 0.64 * kFullscreenDistance;
70 static constexpr float kFullscreenWidth = 1.138 * kFullscreenDistance; 70 static constexpr float kFullscreenWidth = 1.138 * kFullscreenDistance;
71 static constexpr float kFullscreenVerticalOffset = -0.1 * kFullscreenDistance; 71 static constexpr float kFullscreenVerticalOffset = -0.1 * kFullscreenDistance;
72 72
73 // Tiny distance to offset textures that should appear in the same plane. 73 // Tiny distance to offset textures that should appear in the same plane.
74 static constexpr float kTextureOffset = 0.01; 74 static constexpr float kTextureOffset = 0.01;
75 75
76 } // namespace 76 } // namespace
77 77
78 UiSceneManager::UiSceneManager(VrBrowserInterface* browser, 78 UiSceneManager::UiSceneManager(UiBrowserInterface* browser,
79 UiScene* scene, 79 UiScene* scene,
80 bool in_cct, 80 bool in_cct,
81 bool in_web_vr) 81 bool in_web_vr)
82 : browser_(browser), 82 : browser_(browser),
83 scene_(scene), 83 scene_(scene),
84 in_cct_(in_cct), 84 in_cct_(in_cct),
85 web_vr_mode_(in_web_vr), 85 web_vr_mode_(in_web_vr),
86 weak_ptr_factory_(this) { 86 weak_ptr_factory_(this) {
87 CreateBackground(); 87 CreateBackground();
88 CreateContentQuad(); 88 CreateContentQuad();
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 if (fullscreen_) 470 if (fullscreen_)
471 return ColorScheme::kModeFullscreen; 471 return ColorScheme::kModeFullscreen;
472 return ColorScheme::kModeNormal; 472 return ColorScheme::kModeNormal;
473 } 473 }
474 474
475 const ColorScheme& UiSceneManager::color_scheme() const { 475 const ColorScheme& UiSceneManager::color_scheme() const {
476 return ColorScheme::GetColorScheme(mode()); 476 return ColorScheme::GetColorScheme(mode());
477 } 477 }
478 478
479 } // namespace vr_shell 479 } // namespace vr_shell
OLDNEW
« no previous file with comments | « chrome/browser/android/vr_shell/ui_scene_manager.h ('k') | chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698