| 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_TEXTURES_URL_BAR_TEXTURE_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_URL_BAR_TEXTURE_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_URL_BAR_TEXTURE_H_ | 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_URL_BAR_TEXTURE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/callback.h" |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "chrome/browser/android/vr_shell/textures/ui_texture.h" | 13 #include "chrome/browser/android/vr_shell/textures/ui_texture.h" |
| 14 #include "chrome/browser/android/vr_shell/ui_unsupported_mode.h" |
| 13 #include "components/security_state/core/security_state.h" | 15 #include "components/security_state/core/security_state.h" |
| 14 #include "url/gurl.h" | 16 #include "url/gurl.h" |
| 15 | 17 |
| 16 namespace gfx { | 18 namespace gfx { |
| 17 class PointF; | 19 class PointF; |
| 18 class RenderText; | 20 class RenderText; |
| 19 } // namespace gfx | 21 } // namespace gfx |
| 20 | 22 |
| 21 namespace vr_shell { | 23 namespace vr_shell { |
| 22 | 24 |
| 23 class RenderTextWrapper; | 25 class RenderTextWrapper; |
| 24 | 26 |
| 25 class UrlBarTexture : public UiTexture { | 27 class UrlBarTexture : public UiTexture { |
| 26 public: | 28 public: |
| 27 enum DrawFlags { | 29 enum DrawFlags { |
| 28 FLAG_BACK_HOVER = 1 << 0, | 30 FLAG_BACK_HOVER = 1 << 0, |
| 29 FLAG_BACK_DOWN = 1 << 1, | 31 FLAG_BACK_DOWN = 1 << 1, |
| 30 }; | 32 }; |
| 31 | 33 |
| 32 UrlBarTexture(); | 34 explicit UrlBarTexture( |
| 35 const base::Callback<void(UiUnsupportedMode)>& failure_callback); |
| 33 ~UrlBarTexture() override; | 36 ~UrlBarTexture() override; |
| 34 gfx::Size GetPreferredTextureSize(int width) const override; | 37 gfx::Size GetPreferredTextureSize(int width) const override; |
| 35 gfx::SizeF GetDrawnSize() const override; | 38 gfx::SizeF GetDrawnSize() const override; |
| 36 | 39 |
| 37 void SetURL(const GURL& gurl); | 40 void SetURL(const GURL& gurl); |
| 38 void SetSecurityLevel(security_state::SecurityLevel level); | 41 void SetSecurityLevel(security_state::SecurityLevel level); |
| 39 | 42 |
| 40 bool HitsBackButton(const gfx::PointF& position) const; | 43 bool HitsBackButton(const gfx::PointF& position) const; |
| 41 bool HitsUrlBar(const gfx::PointF& position) const; | 44 bool HitsUrlBar(const gfx::PointF& position) const; |
| 42 | 45 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 58 gfx::SizeF size_; | 61 gfx::SizeF size_; |
| 59 bool hovered_ = false; | 62 bool hovered_ = false; |
| 60 bool pressed_ = false; | 63 bool pressed_ = false; |
| 61 | 64 |
| 62 GURL gurl_; | 65 GURL gurl_; |
| 63 security_state::SecurityLevel security_level_; | 66 security_state::SecurityLevel security_level_; |
| 64 | 67 |
| 65 std::unique_ptr<gfx::RenderText> url_render_text_; | 68 std::unique_ptr<gfx::RenderText> url_render_text_; |
| 66 GURL last_drawn_gurl_; | 69 GURL last_drawn_gurl_; |
| 67 security_state::SecurityLevel last_drawn_security_level_; | 70 security_state::SecurityLevel last_drawn_security_level_; |
| 71 base::Callback<void(UiUnsupportedMode)> failure_callback_; |
| 68 | 72 |
| 69 DISALLOW_COPY_AND_ASSIGN(UrlBarTexture); | 73 DISALLOW_COPY_AND_ASSIGN(UrlBarTexture); |
| 70 }; | 74 }; |
| 71 | 75 |
| 72 } // namespace vr_shell | 76 } // namespace vr_shell |
| 73 | 77 |
| 74 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_URL_BAR_TEXTURE_H_ | 78 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_URL_BAR_TEXTURE_H_ |
| OLD | NEW |