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