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

Unified Diff: chrome/browser/android/vr_shell/ui_scene_manager.cc

Issue 2921383002: [vr] Close exit prompt when clicking on background (Closed)
Patch Set: fix diff Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/vr_shell/ui_scene_manager.cc
diff --git a/chrome/browser/android/vr_shell/ui_scene_manager.cc b/chrome/browser/android/vr_shell/ui_scene_manager.cc
index be65c923106125db36cee2fe35cf8224c597a74b..ddef836d9ccf3a6f4d0681c56296aff1b1e995d0 100644
--- a/chrome/browser/android/vr_shell/ui_scene_manager.cc
+++ b/chrome/browser/android/vr_shell/ui_scene_manager.cc
@@ -10,6 +10,7 @@
#include "chrome/browser/android/vr_shell/textures/ui_texture.h"
#include "chrome/browser/android/vr_shell/ui_elements/audio_capture_indicator.h"
#include "chrome/browser/android/vr_shell/ui_elements/button.h"
+#include "chrome/browser/android/vr_shell/ui_elements/content_backplane.h"
#include "chrome/browser/android/vr_shell/ui_elements/exit_prompt.h"
#include "chrome/browser/android/vr_shell/ui_elements/exit_warning.h"
#include "chrome/browser/android/vr_shell/ui_elements/loading_indicator.h"
@@ -213,7 +214,8 @@ void UiSceneManager::CreateContentQuad() {
// Place an invisible but hittable plane behind the content quad, to keep the
// reticle roughly planar with the content if near content.
- element = base::MakeUnique<UiElement>();
+ element = base::MakeUnique<ContentBackplane>(
+ base::Bind(&UiSceneManager::OnBackplaneClicked, base::Unretained(this)));
element->set_debug_id(kBackplane);
element->set_id(AllocateId());
element->set_fill(vr_shell::Fill::NONE);
@@ -457,13 +459,21 @@ void UiSceneManager::OnSecurityIconClicked() {
ConfigureScene();
}
-void UiSceneManager::OnExitPromptPrimaryButtonClicked() {
+void UiSceneManager::OnBackplaneClicked() {
+ CloseExitPrompt();
+}
+
+void UiSceneManager::CloseExitPrompt() {
if (!scene_->is_prompting_to_exit())
return;
scene_->set_is_prompting_to_exit(false);
ConfigureScene();
}
+void UiSceneManager::OnExitPromptPrimaryButtonClicked() {
+ CloseExitPrompt();
+}
+
void UiSceneManager::OnExitPromptSecondaryButtonClicked() {
OnUnsupportedMode(UiUnsupportedMode::kUnhandledPageInfo);
}

Powered by Google App Engine
This is Rietveld 408576698