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

Unified Diff: chrome/browser/ui/toolbar/toolbar_model_impl.cc

Issue 13483010: Add UI notifications for admin-provided SSL certificates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 7 years, 8 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/ui/toolbar/toolbar_model_impl.cc
diff --git a/chrome/browser/ui/toolbar/toolbar_model_impl.cc b/chrome/browser/ui/toolbar/toolbar_model_impl.cc
index fb6d815ac947f7fa577751bcd0bb371de4ca8230..5965fb796845c7e66cad8973979428662eb1fc05 100644
--- a/chrome/browser/ui/toolbar/toolbar_model_impl.cc
+++ b/chrome/browser/ui/toolbar/toolbar_model_impl.cc
@@ -34,6 +34,10 @@
#include "net/cert/x509_certificate.h"
#include "ui/base/l10n/l10n_util.h"
+#if defined(ENABLE_CONFIGURATION_POLICY)
+#include "chrome/browser/policy/browser_policy_connector.h"
+#endif
+
using content::NavigationController;
using content::NavigationEntry;
using content::SSLStatus;
@@ -66,6 +70,11 @@ ToolbarModel::SecurityLevel ToolbarModelImpl::GetSecurityLevelForWebContents(
return SECURITY_ERROR;
case content::SECURITY_STYLE_AUTHENTICATED:
+#if defined(ENABLE_CONFIGURATION_POLICY)
+ if (policy::BrowserPolicyConnector::UsedPolicyCertificates(
+ Profile::FromBrowserContext(web_contents->GetBrowserContext())))
+ return SECURITY_POLICY_WARNING;
+#endif
if (!!(ssl.content_status & SSLStatus::DISPLAYED_INSECURE_CONTENT))
return SECURITY_WARNING;
if (net::IsCertStatusError(ssl.cert_status)) {
@@ -190,6 +199,7 @@ int ToolbarModelImpl::GetIcon() const {
IDR_OMNIBOX_HTTPS_VALID,
IDR_OMNIBOX_HTTPS_VALID,
IDR_OMNIBOX_HTTPS_WARNING,
+ IDR_OMNIBOX_HTTPS_POLICY_WARNING,
IDR_OMNIBOX_HTTPS_INVALID,
};
DCHECK(arraysize(icon_ids) == NUM_SECURITY_LEVELS);

Powered by Google App Engine
This is Rietveld 408576698