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

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

Issue 2742033002: Update scheme text color in Omnibox only in non-default Security Levels (Closed)
Patch Set: 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 689b651ed518fc723481d9294126be3eee28c176..578e71036b3331507313a192c9f5cc63353d83aa 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
@@ -574,11 +574,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)
+ 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