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

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

Issue 2829653003: PROTOTYPE (incomplete): Add quad renderer and stub bits to handle security warnings. (Closed)
Patch Set: Created 3 years, 8 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/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "chrome/browser/android/vr_shell/textured_element.h"
9 #include "chrome/browser/android/vr_shell/textures/ui_texture.h"
8 #include "chrome/browser/android/vr_shell/ui_element.h" 10 #include "chrome/browser/android/vr_shell/ui_element.h"
9 #include "chrome/browser/android/vr_shell/ui_scene.h" 11 #include "chrome/browser/android/vr_shell/ui_scene.h"
10 12
11 namespace vr_shell { 13 namespace vr_shell {
12 14
13 namespace { 15 namespace {
14 16
17 class SecurityWarning : public TexturedElement {
cjgrant 2017/04/19 16:24:52 Temporary home - these shouldn't be in this file.
18 public:
19 SecurityWarning() {
20 //glGenTextures(1, &texture_id_);
21 //texture_ = base::make_unique<InsecureContentPermanentTexture>(texture_id, 1);
22
23 // Draw the texture once since it does not change.
24 //texture_->Draw();
cjgrant 2017/04/19 16:24:52 I figure drawing the one-off textures in the const
25 }
26
27 ~SecurityWarning() override {}
28
29 bool Render(VrShellRenderer* renderer) const override {
30 // Use the Skia quad renderer.
31 return true;
32 }
33
34 private:
35
36 //unsigned int texture_id_;
cjgrant 2017/04/19 16:24:52 FTR, I don't think this should in any way be alloc
37 //std::unique_ptr<UITexture> texture_;
38
39 DISALLOW_COPY_AND_ASSIGN(SecurityWarning);
40 };
41
15 static constexpr int kWarningTimeoutSeconds = 30; 42 static constexpr int kWarningTimeoutSeconds = 30;
16 static constexpr float kWarningDistance = 0.7; 43 static constexpr float kWarningDistance = 0.7;
17 static constexpr float kWarningAngleRadians = 16.3 * M_PI / 180.0; 44 static constexpr float kWarningAngleRadians = 16.3 * M_PI / 180.0;
18 45
19 } // namespace 46 } // namespace
20 47
21 UiSceneManager::UiSceneManager(UiScene* scene) 48 UiSceneManager::UiSceneManager(UiScene* scene)
22 : scene_(scene), weak_ptr_factory_(this) { 49 : scene_(scene), weak_ptr_factory_(this) {
23 std::unique_ptr<UiElement> element; 50 std::unique_ptr<UiElement> element;
24 51
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 } else { 118 } else {
92 security_warning_timer_.Stop(); 119 security_warning_timer_.Stop();
93 } 120 }
94 } 121 }
95 122
96 void UiSceneManager::OnSecurityWarningTimer() { 123 void UiSceneManager::OnSecurityWarningTimer() {
97 transient_security_warning_->visible = false; 124 transient_security_warning_->visible = false;
98 } 125 }
99 126
100 } // namespace vr_shell 127 } // namespace vr_shell
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698