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

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

Issue 1314843007: Refactor connection_security into SecurityStateModel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add SecurityStateModel browser tests; update toolbar model unit tests Created 5 years, 4 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/WebsiteSettingsPopup.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java b/chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java
index 81c1fc003480dea968fed3e80c9e2ccd148d9d0e..5db229f7395d6cc753f39be449ec12e23de13a0e 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java
@@ -53,9 +53,8 @@ import org.chromium.chrome.browser.preferences.Preferences;
import org.chromium.chrome.browser.preferences.PreferencesLauncher;
import org.chromium.chrome.browser.preferences.website.SingleWebsitePreferences;
import org.chromium.chrome.browser.profiles.Profile;
-import org.chromium.chrome.browser.ssl.ConnectionSecurity;
import org.chromium.chrome.browser.ssl.ConnectionSecurityLevel;
-import org.chromium.chrome.browser.toolbar.ToolbarModel;
+import org.chromium.chrome.browser.ssl.SecurityStateModel;
import org.chromium.content.browser.ContentViewCore;
import org.chromium.content_public.browser.WebContents;
import org.chromium.content_public.browser.WebContentsObserver;
@@ -268,6 +267,9 @@ public class WebsiteSettingsPopup implements OnClickListener, OnItemSelectedList
// Whether the security level of the page was deprecated due to SHA-1.
private boolean mDeprecatedSHA1Present;
+ // Whether the security level of the page was deprecated due to passive mixed content.
palmer 2015/09/01 17:39:40 "downgraded", not "deprecated"
estark 2015/09/02 16:27:20 Done.
+ private boolean mPassiveMixedContentPresent;
+
// Whether to use the read-only permissions list.
private boolean mIsReadOnlyDialog;
@@ -421,8 +423,9 @@ public class WebsiteSettingsPopup implements OnClickListener, OnItemSelectedList
mParsedUrl = null;
mIsInternalPage = false;
}
- mSecurityLevel = ConnectionSecurity.getSecurityLevelForWebContents(mWebContents);
- mDeprecatedSHA1Present = ToolbarModel.isDeprecatedSHA1Present(mWebContents);
+ mSecurityLevel = SecurityStateModel.getSecurityLevelForWebContents(mWebContents);
+ mDeprecatedSHA1Present = SecurityStateModel.isDeprecatedSHA1Present(mWebContents);
+ mPassiveMixedContentPresent = SecurityStateModel.isPassiveMixedContentPresent(mWebContents);
palmer 2015/09/01 17:39:40 I suppose I'll find out when I read more, but: How
estark 2015/09/02 16:27:20 I think I haven't yet seen anywhere that Android U
SpannableStringBuilder urlBuilder = new SpannableStringBuilder(mFullUrl);
OmniboxUrlEmphasizer.emphasizeUrl(urlBuilder, mContext.getResources(), mProfile,
@@ -505,9 +508,6 @@ public class WebsiteSettingsPopup implements OnClickListener, OnItemSelectedList
case ConnectionSecurityLevel.SECURE:
case ConnectionSecurityLevel.EV_SECURE:
return R.string.page_info_connection_https;
- case ConnectionSecurityLevel.SECURITY_WARNING:
- case ConnectionSecurityLevel.SECURITY_POLICY_WARNING:
- return R.string.page_info_connection_mixed;
default:
assert false : "Invalid security level specified: " + securityLevel;
return R.string.page_info_connection_http;
@@ -531,7 +531,12 @@ public class WebsiteSettingsPopup implements OnClickListener, OnItemSelectedList
if (mDeprecatedSHA1Present) {
messageBuilder.append(
mContext.getResources().getString(R.string.page_info_connection_sha1));
- } else if (mSecurityLevel != ConnectionSecurityLevel.SECURITY_ERROR) {
+ } else if (mPassiveMixedContentPresent) {
+ messageBuilder.append(
+ mContext.getResources().getString(R.string.page_info_connection_mixed));
+ } else if (mSecurityLevel != ConnectionSecurityLevel.SECURITY_ERROR
+ && mSecurityLevel != ConnectionSecurityLevel.SECURITY_WARNING
+ && mSecurityLevel != ConnectionSecurityLevel.SECURITY_POLICY_WARNING) {
messageBuilder.append(mContext.getResources().getString(
getConnectionMessageId(mSecurityLevel, mIsInternalPage)));
} else {

Powered by Google App Engine
This is Rietveld 408576698