Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2959)

Unified Diff: chrome/browser/android/vr_shell/ui_elements/url_bar.cc

Issue 2872773002: VR: Render the current URL and security level on the URL bar. (Closed)
Patch Set: Revert the inclusion of the lock icon; will re-add when moved to UI. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « chrome/browser/android/vr_shell/ui_elements/url_bar.h ('k') | chrome/browser/android/vr_shell/ui_scene_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698