| 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/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/ui_texture.h" | 9 #include "chrome/browser/android/vr_shell/textures/ui_texture.h" |
| 10 #include "chrome/browser/android/vr_shell/ui_elements/audio_capture_indicator.h" | 10 #include "chrome/browser/android/vr_shell/ui_elements/audio_capture_indicator.h" |
| 11 #include "chrome/browser/android/vr_shell/ui_elements/close_button.h" | 11 #include "chrome/browser/android/vr_shell/ui_elements/close_button.h" |
| 12 #include "chrome/browser/android/vr_shell/ui_elements/loading_indicator.h" | 12 #include "chrome/browser/android/vr_shell/ui_elements/loading_indicator.h" |
| 13 #include "chrome/browser/android/vr_shell/ui_elements/permanent_security_warning
.h" | 13 #include "chrome/browser/android/vr_shell/ui_elements/permanent_security_warning
.h" |
| 14 #include "chrome/browser/android/vr_shell/ui_elements/screen_capture_indicator.h
" |
| 14 #include "chrome/browser/android/vr_shell/ui_elements/transient_security_warning
.h" | 15 #include "chrome/browser/android/vr_shell/ui_elements/transient_security_warning
.h" |
| 15 #include "chrome/browser/android/vr_shell/ui_elements/ui_element.h" | 16 #include "chrome/browser/android/vr_shell/ui_elements/ui_element.h" |
| 16 #include "chrome/browser/android/vr_shell/ui_elements/url_bar.h" | 17 #include "chrome/browser/android/vr_shell/ui_elements/url_bar.h" |
| 17 #include "chrome/browser/android/vr_shell/ui_elements/video_capture_indicator.h" | 18 #include "chrome/browser/android/vr_shell/ui_elements/video_capture_indicator.h" |
| 18 #include "chrome/browser/android/vr_shell/ui_scene.h" | 19 #include "chrome/browser/android/vr_shell/ui_scene.h" |
| 19 #include "chrome/browser/android/vr_shell/vr_browser_interface.h" | 20 #include "chrome/browser/android/vr_shell/vr_browser_interface.h" |
| 20 #include "chrome/browser/android/vr_shell/vr_shell.h" | 21 #include "chrome/browser/android/vr_shell/vr_shell.h" |
| 21 | 22 |
| 22 namespace vr_shell { | 23 namespace vr_shell { |
| 23 | 24 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 scene_->AddUiElement(std::move(element)); | 111 scene_->AddUiElement(std::move(element)); |
| 111 } | 112 } |
| 112 | 113 |
| 113 void UiSceneManager::CreateSystemIndicators() { | 114 void UiSceneManager::CreateSystemIndicators() { |
| 114 std::unique_ptr<UiElement> element; | 115 std::unique_ptr<UiElement> element; |
| 115 | 116 |
| 116 // TODO(acondor): Make constants for sizes and positions once the UX for the | 117 // TODO(acondor): Make constants for sizes and positions once the UX for the |
| 117 // indicators is defined. | 118 // indicators is defined. |
| 118 element = base::MakeUnique<AudioCaptureIndicator>(512); | 119 element = base::MakeUnique<AudioCaptureIndicator>(512); |
| 119 element->set_id(AllocateId()); | 120 element->set_id(AllocateId()); |
| 120 element->set_translation({-0.3, 0.8, -1.9}); | 121 element->set_translation({-0.3, 0.8, -kContentDistance + 0.1}); |
| 121 element->set_size({0.5, 0, 1}); | 122 element->set_size({0.5, 0, 1}); |
| 122 element->set_visible(false); | 123 element->set_visible(false); |
| 123 audio_input_indicator_ = element.get(); | 124 audio_input_indicator_ = element.get(); |
| 124 scene_->AddUiElement(std::move(element)); | 125 scene_->AddUiElement(std::move(element)); |
| 125 | 126 |
| 126 element = base::MakeUnique<VideoCaptureIndicator>(512); | 127 element = base::MakeUnique<VideoCaptureIndicator>(512); |
| 127 element->set_id(AllocateId()); | 128 element->set_id(AllocateId()); |
| 128 element->set_translation({0.3, 0.8, -1.9}); | 129 element->set_translation({0.3, 0.8, -kContentDistance + 0.1}); |
| 129 element->set_size({0.5, 0, 1}); | 130 element->set_size({0.5, 0, 1}); |
| 130 element->set_visible(false); | 131 element->set_visible(false); |
| 131 video_input_indicator_ = element.get(); | 132 video_input_indicator_ = element.get(); |
| 132 scene_->AddUiElement(std::move(element)); | 133 scene_->AddUiElement(std::move(element)); |
| 134 |
| 135 element = base::MakeUnique<ScreenCaptureIndicator>(512); |
| 136 element->set_id(AllocateId()); |
| 137 element->set_translation({0.0, 0.65, -kContentDistance + 0.1}); |
| 138 element->set_size({0.4, 0, 1}); |
| 139 element->set_visible(false); |
| 140 screen_capture_indicator_ = element.get(); |
| 141 scene_->AddUiElement(std::move(element)); |
| 133 } | 142 } |
| 134 | 143 |
| 135 void UiSceneManager::CreateContentQuad() { | 144 void UiSceneManager::CreateContentQuad() { |
| 136 std::unique_ptr<UiElement> element; | 145 std::unique_ptr<UiElement> element; |
| 137 | 146 |
| 138 element = base::MakeUnique<UiElement>(); | 147 element = base::MakeUnique<UiElement>(); |
| 139 element->set_id(AllocateId()); | 148 element->set_id(AllocateId()); |
| 140 element->set_fill(vr_shell::Fill::CONTENT); | 149 element->set_fill(vr_shell::Fill::CONTENT); |
| 141 element->set_size({kContentWidth, kContentHeight, 1}); | 150 element->set_size({kContentWidth, kContentHeight, 1}); |
| 142 element->set_translation({0, kContentVerticalOffset, -kContentDistance}); | 151 element->set_translation({0, kContentVerticalOffset, -kContentDistance}); |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 void UiSceneManager::SetHistoryButtonsEnabled(bool can_go_back, | 358 void UiSceneManager::SetHistoryButtonsEnabled(bool can_go_back, |
| 350 bool can_go_forward) {} | 359 bool can_go_forward) {} |
| 351 | 360 |
| 352 void UiSceneManager::OnCloseButtonClicked() {} | 361 void UiSceneManager::OnCloseButtonClicked() {} |
| 353 | 362 |
| 354 int UiSceneManager::AllocateId() { | 363 int UiSceneManager::AllocateId() { |
| 355 return next_available_id_++; | 364 return next_available_id_++; |
| 356 } | 365 } |
| 357 | 366 |
| 358 } // namespace vr_shell | 367 } // namespace vr_shell |
| OLD | NEW |