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

Side by Side Diff: chrome/browser/android/vr_shell/ui_elements/url_bar.cc

Issue 2902783002: VR: Add URL bar security-related coloring and emphasis. (Closed)
Patch Set: Another test case for HTTPS + not secure. 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 unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698