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

Unified Diff: chrome/browser/android/vr_shell/ui_elements/close_button.h

Issue 2878543002: Refactor VR Shell Input. Locks input to click/scroll targets. (Closed)
Patch Set: Created 3 years, 7 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/close_button.h
diff --git a/chrome/browser/android/vr_shell/ui_elements/close_button.h b/chrome/browser/android/vr_shell/ui_elements/close_button.h
new file mode 100644
index 0000000000000000000000000000000000000000..682364d8d89bfcf7025bc38578fe325435f02c99
--- /dev/null
+++ b/chrome/browser/android/vr_shell/ui_elements/close_button.h
@@ -0,0 +1,43 @@
+// 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.
+
+#ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_CLOSE_BUTTON_H_
+#define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_CLOSE_BUTTON_H_
+
+#include <memory>
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "chrome/browser/android/vr_shell/ui_elements/textured_element.h"
+
+namespace vr_shell {
+
+class CloseButtonTexture;
+class UiTexture;
+
+class CloseButton : public TexturedElement {
+ public:
+ explicit CloseButton(base::Callback<void()> click_handler);
+ ~CloseButton() override;
+
+ void OnHoverLeave() override;
+ void OnHoverEnter(gfx::PointF position) override;
+ void OnButtonDown(gfx::PointF position) override;
+ void OnButtonUp(gfx::PointF position) override;
+
+ private:
+ UiTexture* GetTexture() const override;
+ void OnStateUpdated();
+
+ std::unique_ptr<CloseButtonTexture> texture_;
+ bool down_ = false;
+ bool hover_ = false;
+ base::Callback<void()> click_handler_;
+
+ DISALLOW_COPY_AND_ASSIGN(CloseButton);
+};
+
+} // namespace vr_shell
+
+#endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_CLOSE_BUTTON_H_

Powered by Google App Engine
This is Rietveld 408576698