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

Unified Diff: chrome/browser/android/vr_shell/ui_elements/content_backplane.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_elements/content_backplane.cc
diff --git a/chrome/browser/android/vr_shell/ui_elements/content_backplane.cc b/chrome/browser/android/vr_shell/ui_elements/content_backplane.cc
new file mode 100644
index 0000000000000000000000000000000000000000..fbfa66cd18053ef882518c725d12092e99387338
--- /dev/null
+++ b/chrome/browser/android/vr_shell/ui_elements/content_backplane.cc
@@ -0,0 +1,24 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/android/vr_shell/ui_elements/content_backplane.h"
+
+#include "base/memory/ptr_util.h"
+
+namespace vr_shell {
+
+ContentBackplane::ContentBackplane(const base::Callback<void()>& click_callback)
cjgrant 2017/06/06 19:42:13 Documenting an offline conversation, I think the p
ymalik 2017/06/06 21:11:58 Done. We do need a separate class since UiElement
+ : click_callback_(click_callback) {}
+
+ContentBackplane::~ContentBackplane() = default;
+
+void ContentBackplane::OnButtonUp(const gfx::PointF& position) {
+ // We always run the callback. That is, if the user clicks the controller
+ // button on the backplane and releases it on another element in front of the
+ // backplane, this callback will still be called. Elements are input locked
+ // on button down and it's probably not worth special-casing the backplane.
+ click_callback_.Run();
+}
+
+} // namespace vr_shell

Powered by Google App Engine
This is Rietveld 408576698