| 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_UI_ELEMENTS_URL_BAR_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_URL_BAR_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_URL_BAR_H_ | 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_URL_BAR_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "chrome/browser/android/vr_shell/ui_elements/textured_element.h" | 13 #include "chrome/browser/android/vr_shell/ui_elements/textured_element.h" |
| 14 #include "url/gurl.h" | 14 #include "url/gurl.h" |
| 15 | 15 |
| 16 namespace vr_shell { | 16 namespace vr_shell { |
| 17 | 17 |
| 18 class UrlBarTexture; | 18 class UrlBarTexture; |
| 19 | 19 |
| 20 class UrlBar : public TexturedElement { | 20 class UrlBar : public TexturedElement { |
| 21 public: | 21 public: |
| 22 explicit UrlBar(int preferred_width); | 22 explicit UrlBar(int preferred_width); |
| 23 ~UrlBar() override; | 23 ~UrlBar() override; |
| 24 | 24 |
| 25 void OnHoverEnter(gfx::PointF position) override; | 25 void OnHoverEnter(gfx::PointF position) override; |
| 26 void OnHoverLeave() override; | 26 void OnHoverLeave() override; |
| 27 void OnBeginFrame(const base::TimeTicks& begin_frame_time) override; | 27 void OnBeginFrame(const base::TimeTicks& begin_frame_time) override; |
| 28 void OnButtonUp(gfx::PointF position) override; | 28 void OnButtonUp(gfx::PointF position) override; |
| 29 void SetEnabled(bool enabled); | 29 void SetEnabled(bool enabled) override; |
| 30 | 30 |
| 31 void SetURL(const GURL& gurl); | 31 void SetURL(const GURL& gurl); |
| 32 void SetSecurityLevel(int level); | 32 void SetSecurityLevel(int level); |
| 33 void SetBackButtonCallback(const base::Callback<void()>& callback); | 33 void SetBackButtonCallback(const base::Callback<void()>& callback); |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 void UpdateTexture() override; | 36 void UpdateTexture() override; |
| 37 UiTexture* GetTexture() const override; | 37 UiTexture* GetTexture() const override; |
| 38 std::unique_ptr<UrlBarTexture> texture_; | 38 std::unique_ptr<UrlBarTexture> texture_; |
| 39 base::Callback<void()> back_button_callback_; | 39 base::Callback<void()> back_button_callback_; |
| 40 bool enabled_ = false; | 40 bool enabled_ = false; |
| 41 base::TimeTicks last_begin_frame_time_; | 41 base::TimeTicks last_begin_frame_time_; |
| 42 base::TimeTicks last_update_time_; | 42 base::TimeTicks last_update_time_; |
| 43 | 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(UrlBar); | 44 DISALLOW_COPY_AND_ASSIGN(UrlBar); |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 } // namespace vr_shell | 47 } // namespace vr_shell |
| 48 | 48 |
| 49 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_URL_BAR_H_ | 49 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_UI_ELEMENTS_URL_BAR_H_ |
| OLD | NEW |