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

Unified Diff: chrome/browser/ssl/connection_security_helper.cc

Issue 1162663004: Introduce browser-side plumbing for sending the lock icon status to DevTools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased onto latest master. 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/browser/ssl/connection_security_helper.cc
diff --git a/chrome/browser/ssl/connection_security_helper.cc b/chrome/browser/ssl/connection_security_helper.cc
index 63455835bb614efb709850c2695e0c1a78d84b03..935acf52f08480b457cbd626518b55995f840cb3 100644
--- a/chrome/browser/ssl/connection_security_helper.cc
+++ b/chrome/browser/ssl/connection_security_helper.cc
@@ -128,3 +128,23 @@ ConnectionSecurityHelper::GetSecurityLevelForWebContents(
return NONE;
}
}
+
+content::SecurityStyle ConnectionSecurityHelper::GetSecurityStyleForWebContents(
+ const content::WebContents* web_contents) {
+ SecurityLevel security_level = GetSecurityLevelForWebContents(web_contents);
+
+ switch (security_level) {
+ case NONE:
+ return content::SECURITY_STYLE_UNAUTHENTICATED;
+ case EV_SECURE:
+ case SECURE:
+ return content::SECURITY_STYLE_AUTHENTICATED;
+ case SECURITY_WARNING:
+ case SECURITY_POLICY_WARNING:
+ return content::SECURITY_STYLE_WARNING;
+ case SECURITY_ERROR:
+ return content::SECURITY_STYLE_AUTHENTICATION_BROKEN;
+ }
+ NOTREACHED();
Ryan Sleevi 2015/06/03 23:43:52 nit: tend to prefer a newline between 147 & 148 fo
lgarron 2015/06/04 00:26:34 Done.
+ return content::SECURITY_STYLE_UNKNOWN;
+}

Powered by Google App Engine
This is Rietveld 408576698