| 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_TEXTURES_EXIT_PROMPT_TEXTURE_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_EXIT_PROMPT_TEXTURE_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "chrome/browser/android/vr_shell/textures/ui_texture.h" |
| 10 #include "ui/gfx/geometry/rect_f.h" |
| 11 |
| 12 namespace gfx { |
| 13 class PointF; |
| 14 } // namespace gfx |
| 15 |
| 16 namespace vr_shell { |
| 17 |
| 18 class ExitPromptTexture : public UiTexture { |
| 19 public: |
| 20 ExitPromptTexture(); |
| 21 ~ExitPromptTexture() override; |
| 22 gfx::Size GetPreferredTextureSize(int width) const override; |
| 23 gfx::SizeF GetDrawnSize() const override; |
| 24 |
| 25 void SetPrimaryButtonHovered(bool hovered); |
| 26 void SetPrimaryButtonPressed(bool pressed); |
| 27 void SetSecondaryButtonHovered(bool hovered); |
| 28 void SetSecondaryButtonPressed(bool pressed); |
| 29 |
| 30 virtual bool HitsSecondaryButton(const gfx::PointF& position) const; |
| 31 virtual bool HitsPrimaryButton(const gfx::PointF& position) const; |
| 32 |
| 33 private: |
| 34 void Draw(SkCanvas* sk_canvas, const gfx::Size& texture_size) override; |
| 35 |
| 36 SkColor GetPrimaryButtonColor() const; |
| 37 SkColor GetSecondaryButtonColor() const; |
| 38 float ToPixels(float meters) const; |
| 39 gfx::PointF PercentToPixels(const gfx::PointF& percent) const; |
| 40 |
| 41 gfx::RectF secondary_button_rect_; |
| 42 gfx::RectF primary_button_rect_; |
| 43 gfx::SizeF size_; |
| 44 |
| 45 bool primary_hovered_ = false; |
| 46 bool primary_pressed_ = false; |
| 47 bool secondary_hovered_ = false; |
| 48 bool secondary_pressed_ = false; |
| 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(ExitPromptTexture); |
| 51 }; |
| 52 |
| 53 } // namespace vr_shell |
| 54 |
| 55 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_EXIT_PROMPT_TEXTURE_H_ |
| OLD | NEW |