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