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 #include "chrome/browser/android/vr_shell/ui_elements/url_bar.h" | 5 #include "chrome/browser/android/vr_shell/ui_elements/url_bar.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "chrome/browser/android/vr_shell/textures/url_bar_texture.h" | 8 #include "chrome/browser/android/vr_shell/textures/url_bar_texture.h" |
9 | 9 |
10 namespace vr_shell { | 10 namespace vr_shell { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 void UrlBar::SetEnabled(bool enabled) { | 76 void UrlBar::SetEnabled(bool enabled) { |
77 enabled_ = enabled; | 77 enabled_ = enabled; |
78 set_visible(enabled); | 78 set_visible(enabled); |
79 } | 79 } |
80 | 80 |
81 void UrlBar::SetURL(const GURL& gurl) { | 81 void UrlBar::SetURL(const GURL& gurl) { |
82 texture_->SetURL(gurl); | 82 texture_->SetURL(gurl); |
83 } | 83 } |
84 | 84 |
85 void UrlBar::SetSecurityLevel(int level) { | 85 void UrlBar::SetSecurityLevel(security_state::SecurityLevel level) { |
86 texture_->SetSecurityLevel(level); | 86 texture_->SetSecurityLevel(level); |
87 } | 87 } |
88 | 88 |
89 void UrlBar::SetBackButtonCallback(const base::Callback<void()>& callback) { | 89 void UrlBar::SetBackButtonCallback(const base::Callback<void()>& callback) { |
90 back_button_callback_ = callback; | 90 back_button_callback_ = callback; |
91 } | 91 } |
92 | 92 |
93 void UrlBar::OnStateUpdated(const gfx::PointF& position) { | 93 void UrlBar::OnStateUpdated(const gfx::PointF& position) { |
94 const bool hovered = texture_->HitsBackButton(position); | 94 const bool hovered = texture_->HitsBackButton(position); |
95 const bool pressed = hovered ? down_ : false; | 95 const bool pressed = hovered ? down_ : false; |
96 | 96 |
97 texture_->SetHovered(hovered); | 97 texture_->SetHovered(hovered); |
98 texture_->SetPressed(pressed); | 98 texture_->SetPressed(pressed); |
99 UpdateTexture(); | 99 UpdateTexture(); |
100 } | 100 } |
101 | 101 |
102 } // namespace vr_shell | 102 } // namespace vr_shell |
OLD | NEW |