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 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_CLOSE_BUTTON_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_CLOSE_BUTTON_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_CLOSE_BUTTON_H_ | 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_CLOSE_BUTTON_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "chrome/browser/android/vr_shell/ui_elements/textured_element.h" | 12 #include "chrome/browser/android/vr_shell/ui_elements/textured_element.h" |
| 13 | 13 |
| 14 namespace vr_shell { | 14 namespace vr_shell { |
| 15 | 15 |
| 16 class CloseButtonTexture; | 16 class CloseButtonTexture; |
| 17 class UiTexture; | 17 class UiTexture; |
| 18 | 18 |
| 19 class CloseButton : public TexturedElement { | 19 class CloseButton : public TexturedElement { |
| 20 public: | 20 public: |
| 21 explicit CloseButton(base::Callback<void()> click_handler); | 21 explicit CloseButton(base::Callback<void()> click_handler); |
| 22 ~CloseButton() override; | 22 ~CloseButton() override; |
| 23 | 23 |
| 24 void OnHoverLeave() override; | 24 void OnHoverLeave() override; |
| 25 void OnHoverEnter(gfx::PointF position) override; | 25 void OnHoverEnter(gfx::PointF position) override; |
| 26 void OnMove(gfx::PointF position) override; | |
| 26 void OnButtonDown(gfx::PointF position) override; | 27 void OnButtonDown(gfx::PointF position) override; |
| 27 void OnButtonUp(gfx::PointF position) override; | 28 void OnButtonUp(gfx::PointF position) override; |
| 29 bool HitTest(gfx::PointF point) const override; | |
|
cjgrant
2017/05/15 16:55:09
How are we going to handle elements that have two
mthiesse
2017/05/15 21:11:27
Don't like it, and also "not in this CL". An eleme
| |
| 28 | 30 |
| 29 private: | 31 private: |
| 30 UiTexture* GetTexture() const override; | 32 UiTexture* GetTexture() const override; |
| 31 void OnStateUpdated(); | 33 void OnStateUpdated(gfx::PointF position); |
| 32 | 34 |
| 33 std::unique_ptr<CloseButtonTexture> texture_; | 35 std::unique_ptr<CloseButtonTexture> texture_; |
| 34 bool down_ = false; | 36 bool down_ = false; |
| 35 bool hover_ = false; | |
| 36 base::Callback<void()> click_handler_; | 37 base::Callback<void()> click_handler_; |
| 37 | 38 |
| 38 DISALLOW_COPY_AND_ASSIGN(CloseButton); | 39 DISALLOW_COPY_AND_ASSIGN(CloseButton); |
| 39 }; | 40 }; |
| 40 | 41 |
| 41 } // namespace vr_shell | 42 } // namespace vr_shell |
| 42 | 43 |
| 43 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_CLOSE_BUTTON_H_ | 44 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_CLOSE_BUTTON_H_ |
| OLD | NEW |