Chromium Code Reviews| 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" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 113 void UiSceneManager::CreateSystemIndicators() { | 113 void UiSceneManager::CreateSystemIndicators() { |
| 114 std::unique_ptr<UiElement> element; | 114 std::unique_ptr<UiElement> element; |
| 115 | 115 |
| 116 // TODO(acondor): Make constants for sizes and positions once the UX for the | 116 // TODO(acondor): Make constants for sizes and positions once the UX for the |
| 117 // indicators is defined. | 117 // indicators is defined. |
| 118 element = base::MakeUnique<AudioCaptureIndicator>(256); | 118 element = base::MakeUnique<AudioCaptureIndicator>(256); |
| 119 element->set_id(AllocateId()); | 119 element->set_id(AllocateId()); |
| 120 element->set_translation({-0.3, 0.8, -1.9}); | 120 element->set_translation({-0.3, 0.8, -1.9}); |
| 121 element->set_size({0.4, 0, 1}); | 121 element->set_size({0.4, 0, 1}); |
| 122 element->set_visible(false); | 122 element->set_visible(false); |
| 123 audio_input_indicator_ = element.get(); | 123 audio_capture_indicator_ = element.get(); |
| 124 scene_->AddUiElement(std::move(element)); | 124 scene_->AddUiElement(std::move(element)); |
| 125 | 125 |
| 126 element = base::MakeUnique<VideoCaptureIndicator>(256); | 126 element = base::MakeUnique<VideoCaptureIndicator>(256); |
| 127 element->set_id(AllocateId()); | 127 element->set_id(AllocateId()); |
| 128 element->set_translation({0.3, 0.8, -1.9}); | 128 element->set_translation({0.3, 0.8, -1.9}); |
| 129 element->set_size({0.4, 0, 1}); | 129 element->set_size({0.4, 0, 1}); |
| 130 element->set_visible(false); | 130 element->set_visible(false); |
| 131 video_input_indicator_ = element.get(); | 131 video_capture_indicator_ = element.get(); |
| 132 scene_->AddUiElement(std::move(element)); | 132 scene_->AddUiElement(std::move(element)); |
| 133 } | 133 } |
| 134 | 134 |
| 135 void UiSceneManager::CreateContentQuad() { | 135 void UiSceneManager::CreateContentQuad() { |
| 136 std::unique_ptr<UiElement> element; | 136 std::unique_ptr<UiElement> element; |
| 137 | 137 |
| 138 element = base::MakeUnique<UiElement>(); | 138 element = base::MakeUnique<UiElement>(); |
| 139 element->set_id(AllocateId()); | 139 element->set_id(AllocateId()); |
| 140 element->set_fill(vr_shell::Fill::CONTENT); | 140 element->set_fill(vr_shell::Fill::CONTENT); |
| 141 element->set_size({kContentWidth, kContentHeight, 1}); | 141 element->set_size({kContentWidth, kContentHeight, 1}); |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 281 // Note that main_content_ is already visible in this case. | 281 // Note that main_content_ is already visible in this case. |
| 282 main_content_->set_translation( | 282 main_content_->set_translation( |
| 283 {0, kContentVerticalOffset, -kContentDistance}); | 283 {0, kContentVerticalOffset, -kContentDistance}); |
| 284 main_content_->set_size({kContentWidth, kContentHeight, 1}); | 284 main_content_->set_size({kContentWidth, kContentHeight, 1}); |
| 285 } | 285 } |
| 286 | 286 |
| 287 scene_->SetBackgroundDistance(main_content_->translation().z() * | 287 scene_->SetBackgroundDistance(main_content_->translation().z() * |
| 288 -kBackgroundDistanceMultiplier); | 288 -kBackgroundDistanceMultiplier); |
| 289 } | 289 } |
| 290 | 290 |
| 291 void UiSceneManager::SetAudioCapturingIndicator(bool enabled) { | |
| 292 audio_capture_indicator_->set_visible(enabled); | |
|
cjgrant
2017/05/16 21:31:38
As of now, theses will show up in WebVR. You coul
amp
2017/05/16 22:24:44
Is there a possibility that they need to show up i
asimjour1
2017/05/17 14:42:20
This looks to be out of scope of this CL. I'll sta
cjgrant
2017/05/17 14:57:31
If they do show up in WebVR, presumably they have
| |
| 293 } | |
| 294 | |
| 295 void UiSceneManager::SetVideoCapturingIndicator(bool enabled) { | |
| 296 video_capture_indicator_->set_visible(enabled); | |
| 297 } | |
| 298 | |
| 299 void UiSceneManager::SetScreenCapturingIndicator(bool enabled) { | |
| 300 // TODO(asimjour) add the indicator and change the visibility here. | |
| 301 } | |
| 302 | |
| 291 void UiSceneManager::SetWebVrSecureOrigin(bool secure) { | 303 void UiSceneManager::SetWebVrSecureOrigin(bool secure) { |
| 292 secure_origin_ = secure; | 304 secure_origin_ = secure; |
| 293 ConfigureSecurityWarnings(); | 305 ConfigureSecurityWarnings(); |
| 294 } | 306 } |
| 295 | 307 |
| 296 void UiSceneManager::OnAppButtonClicked() { | 308 void UiSceneManager::OnAppButtonClicked() { |
| 297 // App button click exits the WebVR presentation and fullscreen. | 309 // App button click exits the WebVR presentation and fullscreen. |
| 298 browser_->ExitPresent(); | 310 browser_->ExitPresent(); |
| 299 browser_->ExitFullscreen(); | 311 browser_->ExitFullscreen(); |
| 300 } | 312 } |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 349 void UiSceneManager::SetHistoryButtonsEnabled(bool can_go_back, | 361 void UiSceneManager::SetHistoryButtonsEnabled(bool can_go_back, |
| 350 bool can_go_forward) {} | 362 bool can_go_forward) {} |
| 351 | 363 |
| 352 void UiSceneManager::OnCloseButtonClicked() {} | 364 void UiSceneManager::OnCloseButtonClicked() {} |
| 353 | 365 |
| 354 int UiSceneManager::AllocateId() { | 366 int UiSceneManager::AllocateId() { |
| 355 return next_available_id_++; | 367 return next_available_id_++; |
| 356 } | 368 } |
| 357 | 369 |
| 358 } // namespace vr_shell | 370 } // namespace vr_shell |
| OLD | NEW |