Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_EXIT_PROMPT_H_ | |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_EXIT_PROMPT_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 | |
| 10 #include "base/callback.h" | |
| 11 #include "base/macros.h" | |
| 12 #include "chrome/browser/android/vr_shell/ui_elements/textured_element.h" | |
| 13 | |
| 14 namespace vr_shell { | |
| 15 | |
| 16 class ExitPromptTexture; | |
| 17 | |
| 18 class ExitPrompt : public TexturedElement { | |
| 19 public: | |
| 20 ExitPrompt(int preferred_width, | |
| 21 const base::Callback<void()>& primary_button_callback, | |
| 22 const base::Callback<void()>& secondary_buttton_callback); | |
| 23 ~ExitPrompt() override; | |
| 24 | |
| 25 void SetTextureForTesting(ExitPromptTexture* texture); | |
| 26 | |
| 27 void OnHoverEnter(const gfx::PointF& position) override; | |
| 28 void OnHoverLeave() override; | |
| 29 void OnMove(const gfx::PointF& position) override; | |
| 30 void OnButtonDown(const gfx::PointF& position) override; | |
| 31 void OnButtonUp(const gfx::PointF& position) override; | |
| 32 | |
| 33 private: | |
| 34 UiTexture* GetTexture() const override; | |
| 35 | |
| 36 // TODO(ymalik): Should this move into a parent class? | |
|
cjgrant
2017/06/05 17:33:53
Can we drop the todo? Should either be a bug file
ymalik
2017/06/05 20:02:42
Done.
| |
| 37 void OnStateUpdated(const gfx::PointF& position); | |
| 38 | |
| 39 bool primary_down_ = false; | |
| 40 bool secondary_down_ = false; | |
| 41 | |
| 42 std::unique_ptr<ExitPromptTexture> texture_; | |
| 43 | |
| 44 base::Callback<void()> primary_button_callback_; | |
| 45 base::Callback<void()> secondary_buttton_callback_; | |
| 46 | |
| 47 DISALLOW_COPY_AND_ASSIGN(ExitPrompt); | |
| 48 }; | |
| 49 | |
| 50 } // namespace vr_shell | |
| 51 | |
| 52 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_EXIT_PROMPT_H_ | |
| OLD | NEW |