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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/omnibox/OmniboxUrlEmphasizer.java

Issue 2145243002: Revert of [android] Correct the URL scheme colors in the Omnibox. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/android/java/src/org/chromium/chrome/browser/omnibox/OmniboxUrlEmphasizer.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/OmniboxUrlEmphasizer.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/OmniboxUrlEmphasizer.java
index 4f46765edb04e3c6d9cb2dda2868ed6ff6ed5bc3..986ea1316f577234ab79e9a8578c4ff10845e0d9 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/OmniboxUrlEmphasizer.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/OmniboxUrlEmphasizer.java
@@ -128,9 +128,13 @@
public static void emphasizeUrl(Spannable url, Resources resources, Profile profile,
int securityLevel, boolean isInternalPage,
boolean useDarkColors, boolean emphasizeHttpsScheme) {
- assert useDarkColors ? true : !emphasizeHttpsScheme;
+ assert (securityLevel == ConnectionSecurityLevel.SECURITY_ERROR
+ || securityLevel == ConnectionSecurityLevel.SECURITY_WARNING)
+ ? emphasizeHttpsScheme
+ : true;
String urlString = url.toString();
+
EmphasizeComponentsResponse emphasizeResponse =
parseForEmphasizeComponents(profile, urlString);
@@ -145,25 +149,29 @@
int startHostIndex = emphasizeResponse.hostStart;
int endHostIndex = emphasizeResponse.hostStart + emphasizeResponse.hostLength;
- // Color the HTTPS scheme.
+ // Add the https scheme highlight
ForegroundColorSpan span;
if (emphasizeResponse.hasScheme()) {
int colorId = nonEmphasizedColorId;
- if (!isInternalPage) {
+ if (!isInternalPage && emphasizeHttpsScheme) {
boolean strikeThroughScheme = false;
switch (securityLevel) {
case ConnectionSecurityLevel.NONE:
- // Intentional fall-through:
+ colorId = nonEmphasizedColorId;
+ break;
case ConnectionSecurityLevel.SECURITY_WARNING:
+ colorId = R.color.url_emphasis_start_scheme_security_warning;
+ strikeThroughScheme = true;
break;
case ConnectionSecurityLevel.SECURITY_ERROR:
- if (emphasizeHttpsScheme) colorId = R.color.google_red_700;
+ colorId = R.color.url_emphasis_start_scheme_security_error;
strikeThroughScheme = true;
break;
case ConnectionSecurityLevel.EV_SECURE:
- // Intentional fall-through:
+ colorId = R.color.url_emphasis_start_scheme_ev_secure;
+ break;
case ConnectionSecurityLevel.SECURE:
- if (emphasizeHttpsScheme) colorId = R.color.google_green_700;
+ colorId = R.color.url_emphasis_start_scheme_secure;
break;
default:
assert false;

Powered by Google App Engine
This is Rietveld 408576698