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_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 struct ColorScheme; | |
| 19 | |
| 20 class ExitPromptTexture : public UiTexture { | |
| 21 public: | |
| 22 ExitPromptTexture(); | |
| 23 ~ExitPromptTexture() override; | |
| 24 gfx::Size GetPreferredTextureSize(int width) const override; | |
| 25 gfx::SizeF GetDrawnSize() const override; | |
| 26 | |
| 27 void SetPrimaryHovered(bool hovered); | |
|
cjgrant
2017/06/02 04:16:36
Maybe call these SetPrimaryButtonHovered, etc. to
ymalik
2017/06/02 21:14:31
Done.
| |
| 28 void SetPrimaryPressed(bool pressed); | |
| 29 void SetSecondaryHovered(bool hovered); | |
| 30 void SetSecondaryPressed(bool pressed); | |
| 31 | |
| 32 bool HitsSecondaryButton(const gfx::PointF& position) const; | |
| 33 bool HitsPrimaryButton(const gfx::PointF& position) const; | |
| 34 | |
| 35 private: | |
| 36 void Draw(SkCanvas* sk_canvas, const gfx::Size& texture_size) override; | |
| 37 | |
| 38 float ToPixels(float meters) const; | |
| 39 gfx::PointF percentToPixels(const gfx::PointF& percent) const; | |
| 40 const ColorScheme& color_scheme() const; | |
| 41 | |
| 42 gfx::RectF secondary_button_rect_; | |
| 43 gfx::RectF primary_button_rect_; | |
| 44 gfx::SizeF size_; | |
| 45 | |
| 46 bool primary_hovered_ = false; | |
| 47 bool primary_pressed_ = false; | |
| 48 bool secondary_hovered_ = false; | |
| 49 bool secondary_pressed_ = false; | |
| 50 | |
| 51 DISALLOW_COPY_AND_ASSIGN(ExitPromptTexture); | |
| 52 }; | |
| 53 | |
| 54 } // namespace vr_shell | |
| 55 | |
| 56 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_EXIT_PROMPT_TEXTURE_H_ | |
| OLD | NEW |