| OLD | NEW |
| 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/textures/ui_texture.h" | 8 #include "chrome/browser/android/vr_shell/textures/ui_texture.h" |
| 9 #include "chrome/browser/android/vr_shell/ui_elements/permanent_security_warning
.h" | 9 #include "chrome/browser/android/vr_shell/ui_elements/permanent_security_warning
.h" |
| 10 #include "chrome/browser/android/vr_shell/ui_elements/textured_element.h" | 10 #include "chrome/browser/android/vr_shell/ui_elements/textured_element.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 // For now, use an ID range that does not conflict with the HTML UI. | 29 // For now, use an ID range that does not conflict with the HTML UI. |
| 30 int id = 1000; | 30 int id = 1000; |
| 31 | 31 |
| 32 // Permanent WebVR security warning. | 32 // Permanent WebVR security warning. |
| 33 // TODO(mthiesse): Programatically compute the proper texture size for these | 33 // TODO(mthiesse): Programatically compute the proper texture size for these |
| 34 // textured UI elements. | 34 // textured UI elements. |
| 35 element = base::MakeUnique<PermanentSecurityWarning>(512); | 35 element = base::MakeUnique<PermanentSecurityWarning>(512); |
| 36 element->id = id++; | 36 element->id = id++; |
| 37 element->name = "Permanent security warning"; | 37 element->name = "Permanent security warning"; |
| 38 element->fill = vr_shell::Fill::NONE; | 38 element->fill = vr_shell::Fill::NONE; |
| 39 element->size = {0.226f, 0.078f, 1}; | 39 element->size = {0.224f, 0.070f, 1}; |
| 40 element->scale = {kWarningDistance, kWarningDistance, 1}; | 40 element->scale = {kWarningDistance, kWarningDistance, 1}; |
| 41 element->translation = {0, kWarningDistance * sin(kWarningAngleRadians), | 41 element->translation = {0, kWarningDistance * sin(kWarningAngleRadians), |
| 42 -kWarningDistance * cos(kWarningAngleRadians)}; | 42 -kWarningDistance * cos(kWarningAngleRadians)}; |
| 43 element->rotation = {1.0f, 0, 0, kWarningAngleRadians}; | 43 element->rotation = {1.0f, 0, 0, kWarningAngleRadians}; |
| 44 element->visible = false; | 44 element->visible = false; |
| 45 element->hit_testable = false; | 45 element->hit_testable = false; |
| 46 element->lock_to_fov = true; | 46 element->lock_to_fov = true; |
| 47 permanent_security_warning_ = element.get(); | 47 permanent_security_warning_ = element.get(); |
| 48 scene_->AddUiElement(std::move(element)); | 48 scene_->AddUiElement(std::move(element)); |
| 49 | 49 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 } else { | 101 } else { |
| 102 security_warning_timer_.Stop(); | 102 security_warning_timer_.Stop(); |
| 103 } | 103 } |
| 104 } | 104 } |
| 105 | 105 |
| 106 void UiSceneManager::OnSecurityWarningTimer() { | 106 void UiSceneManager::OnSecurityWarningTimer() { |
| 107 transient_security_warning_->visible = false; | 107 transient_security_warning_->visible = false; |
| 108 } | 108 } |
| 109 | 109 |
| 110 } // namespace vr_shell | 110 } // namespace vr_shell |
| OLD | NEW |