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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_view_views.cc

Issue 2734783007: Update scheme text color in Omnibox only in non-default Security Levels (Closed)
Patch Set: Update comment Created 3 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/omnibox/omnibox_view_views.cc
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
index 232425595c279a63cf8d8db6a3bb6d8310597f78..30898ddedc0e1cb1ea1cf5733cde46890fc9e46e 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
@@ -570,11 +570,16 @@ void OmniboxViewViews::SetEmphasis(bool emphasize, const gfx::Range& range) {
void OmniboxViewViews::UpdateSchemeStyle(const gfx::Range& range) {
DCHECK(range.IsValid());
- const SkColor security_color =
- location_bar_view_->GetSecureTextColor(security_level_);
- const bool strike = security_level_ == security_state::DANGEROUS;
- ApplyColor(security_color, range);
- ApplyStyle(gfx::DIAGONAL_STRIKE, strike, range);
+ // Only SECURE and DANGEROUS levels (pages served over HTTPS or flagged by
+ // SafeBrowsing) get a special scheme color treatment. If the security level
+ // is NONE or HTTP_SHOW_WARNING, we do not override the text style previously
+ // applied to the scheme text range by SetEmphasis().
+ if (security_level_ == security_state::NONE ||
+ security_level_ == security_state::HTTP_SHOW_WARNING)
Peter Kasting 2017/03/09 06:02:42 The addition of HTTP_SHOW_WARNING here is a views
+ return;
+ ApplyColor(location_bar_view_->GetSecureTextColor(security_level_), range);
+ if (security_level_ == security_state::DANGEROUS)
+ ApplyStyle(gfx::DIAGONAL_STRIKE, true, range);
}
void OmniboxViewViews::EmphasizeURLComponents() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698