Chromium Code Reviews| Index: chrome/browser/android/vr_shell/ui_elements/exit_prompt.h |
| diff --git a/chrome/browser/android/vr_shell/ui_elements/exit_prompt.h b/chrome/browser/android/vr_shell/ui_elements/exit_prompt.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..3593757264b93bb3fb65062ca85e742d9faf86ba |
| --- /dev/null |
| +++ b/chrome/browser/android/vr_shell/ui_elements/exit_prompt.h |
| @@ -0,0 +1,52 @@ |
| +// 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_EXIT_PROMPT_H_ |
| +#define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_EXIT_PROMPT_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 ExitPromptTexture; |
| + |
| +class ExitPrompt : public TexturedElement { |
| + public: |
| + ExitPrompt(int preferred_width, |
| + const base::Callback<void()>& primary_button_callback, |
| + const base::Callback<void()>& secondary_buttton_callback); |
| + ~ExitPrompt() override; |
| + |
| + void SetTextureForTesting(ExitPromptTexture* texture); |
| + |
| + void OnHoverEnter(const gfx::PointF& position) override; |
| + void OnHoverLeave() override; |
| + void OnMove(const gfx::PointF& position) override; |
| + void OnButtonDown(const gfx::PointF& position) override; |
| + void OnButtonUp(const gfx::PointF& position) override; |
| + |
| + private: |
| + UiTexture* GetTexture() const override; |
| + |
| + // 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.
|
| + void OnStateUpdated(const gfx::PointF& position); |
| + |
| + bool primary_down_ = false; |
| + bool secondary_down_ = false; |
| + |
| + std::unique_ptr<ExitPromptTexture> texture_; |
| + |
| + base::Callback<void()> primary_button_callback_; |
| + base::Callback<void()> secondary_buttton_callback_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ExitPrompt); |
| +}; |
| + |
| +} // namespace vr_shell |
| + |
| +#endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_EXIT_PROMPT_H_ |