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/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" |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 336 base::WeakPtr<UiSceneManager> UiSceneManager::GetWeakPtr() { | 336 base::WeakPtr<UiSceneManager> UiSceneManager::GetWeakPtr() { |
| 337 return weak_ptr_factory_.GetWeakPtr(); | 337 return weak_ptr_factory_.GetWeakPtr(); |
| 338 } | 338 } |
| 339 | 339 |
| 340 void UiSceneManager::SetWebVrMode(bool web_vr) { | 340 void UiSceneManager::SetWebVrMode(bool web_vr) { |
| 341 if (web_vr_mode_ == web_vr) | 341 if (web_vr_mode_ == web_vr) |
| 342 return; | 342 return; |
| 343 web_vr_mode_ = web_vr; | 343 web_vr_mode_ = web_vr; |
| 344 ConfigureScene(); | 344 ConfigureScene(); |
| 345 ConfigureSecurityWarnings(); | 345 ConfigureSecurityWarnings(); |
| 346 if (web_vr) { | |
|
cjgrant
2017/05/26 14:08:15
More detailed explanation:
The way this is coded,
asimjour1
2017/05/26 17:00:59
Updated according to the offline discussion
| |
| 347 audio_capture_indicator_->set_visible(false); | |
| 348 video_capture_indicator_->set_visible(false); | |
| 349 screen_capture_indicator_->set_visible(false); | |
| 350 } | |
| 346 } | 351 } |
| 347 | 352 |
| 348 void UiSceneManager::ConfigureScene() { | 353 void UiSceneManager::ConfigureScene() { |
| 349 exit_warning_->SetEnabled(scene_->is_exiting()); | 354 exit_warning_->SetEnabled(scene_->is_exiting()); |
| 350 screen_dimmer_->SetEnabled(scene_->is_exiting()); | 355 screen_dimmer_->SetEnabled(scene_->is_exiting()); |
| 351 | 356 |
| 352 // Controls (URL bar, loading progress, etc). | 357 // Controls (URL bar, loading progress, etc). |
| 353 bool controls_visible = !web_vr_mode_ && !fullscreen_; | 358 bool controls_visible = !web_vr_mode_ && !fullscreen_; |
| 354 for (UiElement* element : control_elements_) { | 359 for (UiElement* element : control_elements_) { |
| 355 element->SetEnabled(controls_visible); | 360 element->SetEnabled(controls_visible); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 388 floor_->set_center_color(center_color); | 393 floor_->set_center_color(center_color); |
| 389 ceiling_->set_edge_color(horizon_color); | 394 ceiling_->set_edge_color(horizon_color); |
| 390 ceiling_->set_center_color(center_color); | 395 ceiling_->set_center_color(center_color); |
| 391 floor_grid_->set_center_color(horizon_color); | 396 floor_grid_->set_center_color(horizon_color); |
| 392 vr::Colorf edge_color = horizon_color; | 397 vr::Colorf edge_color = horizon_color; |
| 393 edge_color.a = 0.0; | 398 edge_color.a = 0.0; |
| 394 floor_grid_->set_edge_color(edge_color); | 399 floor_grid_->set_edge_color(edge_color); |
| 395 } | 400 } |
| 396 | 401 |
| 397 void UiSceneManager::SetAudioCapturingIndicator(bool enabled) { | 402 void UiSceneManager::SetAudioCapturingIndicator(bool enabled) { |
| 398 audio_capture_indicator_->set_visible(enabled); | 403 audio_capture_indicator_->set_visible(enabled && !web_vr_mode_); |
| 399 } | 404 } |
| 400 | 405 |
| 401 void UiSceneManager::SetVideoCapturingIndicator(bool enabled) { | 406 void UiSceneManager::SetVideoCapturingIndicator(bool enabled) { |
| 402 video_capture_indicator_->set_visible(enabled); | 407 video_capture_indicator_->set_visible(enabled && !web_vr_mode_); |
| 403 } | 408 } |
| 404 | 409 |
| 405 void UiSceneManager::SetScreenCapturingIndicator(bool enabled) { | 410 void UiSceneManager::SetScreenCapturingIndicator(bool enabled) { |
| 406 // TODO(asimjour) add the indicator and change the visibility here. | 411 screen_capture_indicator_->set_visible(enabled && !web_vr_mode_); |
| 407 } | 412 } |
| 408 | 413 |
| 409 void UiSceneManager::SetWebVrSecureOrigin(bool secure) { | 414 void UiSceneManager::SetWebVrSecureOrigin(bool secure) { |
| 410 secure_origin_ = secure; | 415 secure_origin_ = secure; |
| 411 ConfigureSecurityWarnings(); | 416 ConfigureSecurityWarnings(); |
| 412 } | 417 } |
| 413 | 418 |
| 414 void UiSceneManager::OnAppButtonClicked() { | 419 void UiSceneManager::OnAppButtonClicked() { |
| 415 // App button click exits the WebVR presentation and fullscreen. | 420 // App button click exits the WebVR presentation and fullscreen. |
| 416 browser_->ExitPresent(); | 421 browser_->ExitPresent(); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 476 | 481 |
| 477 void UiSceneManager::OnCloseButtonClicked() { | 482 void UiSceneManager::OnCloseButtonClicked() { |
| 478 browser_->ExitCct(); | 483 browser_->ExitCct(); |
| 479 } | 484 } |
| 480 | 485 |
| 481 int UiSceneManager::AllocateId() { | 486 int UiSceneManager::AllocateId() { |
| 482 return next_available_id_++; | 487 return next_available_id_++; |
| 483 } | 488 } |
| 484 | 489 |
| 485 } // namespace vr_shell | 490 } // namespace vr_shell |
| OLD | NEW |