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; |