| 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> |
| 9 #include <vector> |
| 10 |
| 8 #include "chrome/browser/android/vr_shell/textures/ui_texture.h" | 11 #include "chrome/browser/android/vr_shell/textures/ui_texture.h" |
| 12 #include "url/gurl.h" |
| 9 | 13 |
| 10 #include "url/gurl.h" | 14 namespace gfx { |
| 15 class RenderText; |
| 16 } // namespace gfx |
| 11 | 17 |
| 12 namespace vr_shell { | 18 namespace vr_shell { |
| 13 | 19 |
| 14 class UrlBarTexture : public UiTexture { | 20 class UrlBarTexture : public UiTexture { |
| 15 public: | 21 public: |
| 16 UrlBarTexture(); | 22 UrlBarTexture(); |
| 17 ~UrlBarTexture() override; | 23 ~UrlBarTexture() override; |
| 18 gfx::Size GetPreferredTextureSize(int width) const override; | 24 gfx::Size GetPreferredTextureSize(int width) const override; |
| 19 gfx::SizeF GetDrawnSize() const override; | 25 gfx::SizeF GetDrawnSize() const override; |
| 20 | 26 |
| 21 void SetHover(bool hover); | 27 void SetHover(bool hover); |
| 22 void SetURL(const GURL& gurl); | 28 void SetURL(const GURL& gurl); |
| 23 void SetSecurityLevel(int level); | 29 void SetSecurityLevel(int level); |
| 24 | 30 |
| 25 private: | 31 private: |
| 26 void Draw(SkCanvas* canvas, const gfx::Size& texture_size) override; | 32 void Draw(SkCanvas* canvas, const gfx::Size& texture_size) override; |
| 27 float ToPixels(float meters) const; | 33 float ToPixels(float meters) const; |
| 28 | 34 |
| 29 gfx::SizeF size_; | 35 gfx::SizeF size_; |
| 30 bool hover_ = false; | 36 bool hover_ = false; |
| 31 int security_level_; | 37 int security_level_; |
| 32 GURL gurl_; | 38 GURL gurl_; |
| 39 GURL last_drawn_gurl_; |
| 40 std::vector<std::unique_ptr<gfx::RenderText>> gurl_render_texts_; |
| 33 }; | 41 }; |
| 34 | 42 |
| 35 } // namespace vr_shell | 43 } // namespace vr_shell |
| 36 | 44 |
| 37 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_URL_BAR_TEXTURE_H_ | 45 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_URL_BAR_TEXTURE_H_ |
| OLD | NEW |