| Index: chrome/browser/android/vr_shell/ui_elements/url_bar.cc
|
| diff --git a/chrome/browser/android/vr_shell/ui_elements/url_bar.cc b/chrome/browser/android/vr_shell/ui_elements/url_bar.cc
|
| index 7e8d9c49a9b0c6d3c0fa5a5da06e9c33362c7179..87deb9213c874d4610fbbf9601d7c5540650af16 100644
|
| --- a/chrome/browser/android/vr_shell/ui_elements/url_bar.cc
|
| +++ b/chrome/browser/android/vr_shell/ui_elements/url_bar.cc
|
| @@ -15,6 +15,10 @@ UrlBar::UrlBar(int preferred_width)
|
|
|
| UrlBar::~UrlBar() = default;
|
|
|
| +UiTexture* UrlBar::GetTexture() const {
|
| + return texture_.get();
|
| +}
|
| +
|
| void UrlBar::OnHoverEnter() {
|
| texture_->SetHover(true);
|
| Update();
|
| @@ -25,12 +29,35 @@ void UrlBar::OnHoverLeave() {
|
| Update();
|
| }
|
|
|
| -UiTexture* UrlBar::GetTexture() const {
|
| - return texture_.get();
|
| +void UrlBar::OnButtonUp() {
|
| + back_button_callback_.Run();
|
| +}
|
| +
|
| +void UrlBar::SetEnabled(bool enabled) {
|
| + if (enabled && !enabled_) {
|
| + Update();
|
| + }
|
| + enabled_ = enabled;
|
| }
|
|
|
| void UrlBar::SetURL(const GURL& gurl) {
|
| + // TODO(cjgrant): See if we get duplicate security level numbers, despite the
|
| + // source of this information being called "on changed". Also, consider
|
| + // delaying the texture update slighly, such that back-to-back URL and
|
| + // security state changes generate a single texture update instead of two.
|
| texture_->SetURL(gurl);
|
| + if (enabled_)
|
| + Update();
|
| +}
|
| +
|
| +void UrlBar::SetSecurityLevel(int level) {
|
| + texture_->SetSecurityLevel(level);
|
| + if (enabled_)
|
| + Update();
|
| +}
|
| +
|
| +void UrlBar::SetBackButtonCallback(const base::Callback<void()>& callback) {
|
| + back_button_callback_ = callback;
|
| }
|
|
|
| } // namespace vr_shell
|
|
|