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

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

Issue 1123943002: Move SecurityLevel into a class of its own (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert GetSecurityLevelForNonSecureFieldTrial change Created 5 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 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 52b65b74728078efc6dcf028b8c66f5303f2ab51..9cf8e6994d931bd1532ec33fba9c7fb8d0286d7e 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
@@ -12,7 +12,7 @@ import android.text.style.StrikethroughSpan;
import org.chromium.base.VisibleForTesting;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.profiles.Profile;
-import org.chromium.chrome.browser.ui.toolbar.ToolbarModelSecurityLevel;
+import org.chromium.chrome.browser.ssl.ConnectionSecurityHelperSecurityLevel;
import java.util.Locale;
@@ -135,7 +135,7 @@ public class OmniboxUrlEmphasizer {
* modified.
* @param resources Resources for the given application context.
* @param profile The profile viewing the given URL.
- * @param securityLevel A valid ToolbarModelSecurityLevel for the specified
+ * @param securityLevel A valid ConnectionSecurityHelperSecurityLevel for the specified
* web contents.
* @param isInternalPage Whether this page is an internal Chrome page.
* @param useDarkColors Whether the text colors should be dark (i.e.
@@ -164,25 +164,26 @@ public class OmniboxUrlEmphasizer {
if (emphasizeResponse.hasScheme()) {
int colorId = nonEmphasizedColorId;
if (!isInternalPage
- && (useDarkColors || securityLevel
- == ToolbarModelSecurityLevel.SECURITY_ERROR)) {
+ && (useDarkColors
+ || securityLevel
+ == ConnectionSecurityHelperSecurityLevel.SECURITY_ERROR)) {
switch (securityLevel) {
- case ToolbarModelSecurityLevel.NONE:
+ case ConnectionSecurityHelperSecurityLevel.NONE:
colorId = nonEmphasizedColorId;
break;
- case ToolbarModelSecurityLevel.SECURITY_WARNING:
+ case ConnectionSecurityHelperSecurityLevel.SECURITY_WARNING:
colorId = R.color.url_emphasis_start_scheme_security_warning;
break;
- case ToolbarModelSecurityLevel.SECURITY_ERROR:
+ case ConnectionSecurityHelperSecurityLevel.SECURITY_ERROR:
colorId = R.color.url_emphasis_start_scheme_security_error;
UrlEmphasisSecurityErrorSpan ss = new UrlEmphasisSecurityErrorSpan();
url.setSpan(ss, startSchemeIndex, endSchemeIndex,
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
break;
- case ToolbarModelSecurityLevel.EV_SECURE:
+ case ConnectionSecurityHelperSecurityLevel.EV_SECURE:
colorId = R.color.url_emphasis_start_scheme_ev_secure;
break;
- case ToolbarModelSecurityLevel.SECURE:
+ case ConnectionSecurityHelperSecurityLevel.SECURE:
colorId = R.color.url_emphasis_start_scheme_secure;
break;
default:

Powered by Google App Engine
This is Rietveld 408576698