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

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

Issue 24153012: Fix cyclic dependency between ProfilePolicyConnector and PrefService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed. Created 7 years, 1 month 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
« no previous file with comments | « chrome/browser/profiles/profile_io_data.cc ('k') | chrome/browser/ui/website_settings/website_settings.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fab4b9872b7bc3ca884abe982083dbf5c95072b2..0ca687796f4d95a22f5aace824f349c9472c8283 100644
--- a/chrome/browser/ui/toolbar/toolbar_model_impl.cc
+++ b/chrome/browser/ui/toolbar/toolbar_model_impl.cc
@@ -12,8 +12,6 @@
#include "chrome/browser/autocomplete/autocomplete_input.h"
#include "chrome/browser/autocomplete/autocomplete_match.h"
#include "chrome/browser/google/google_util.h"
-#include "chrome/browser/policy/profile_policy_connector.h"
-#include "chrome/browser/policy/profile_policy_connector_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search/search.h"
#include "chrome/browser/ssl/ssl_error_info.h"
@@ -36,6 +34,11 @@
#include "net/cert/x509_certificate.h"
#include "ui/base/l10n/l10n_util.h"
+#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/policy/policy_cert_service.h"
+#include "chrome/browser/chromeos/policy/policy_cert_service_factory.h"
+#endif
+
using content::NavigationController;
using content::NavigationEntry;
using content::SSLStatus;
@@ -66,11 +69,14 @@ ToolbarModel::SecurityLevel ToolbarModelImpl::GetSecurityLevelForWebContents(
case content::SECURITY_STYLE_AUTHENTICATION_BROKEN:
return SECURITY_ERROR;
- case content::SECURITY_STYLE_AUTHENTICATED:
- if (policy::ProfilePolicyConnectorFactory::GetForProfile(
- Profile::FromBrowserContext(web_contents->GetBrowserContext()))->
- UsedPolicyCertificates())
+ case content::SECURITY_STYLE_AUTHENTICATED: {
+#if defined(OS_CHROMEOS)
+ policy::PolicyCertService* service =
+ policy::PolicyCertServiceFactory::GetForProfile(
+ Profile::FromBrowserContext(web_contents->GetBrowserContext()));
+ if (service && service->UsedPolicyCertificates())
return SECURITY_POLICY_WARNING;
+#endif
if (!!(ssl.content_status & SSLStatus::DISPLAYED_INSECURE_CONTENT))
return SECURITY_WARNING;
if (net::IsCertStatusError(ssl.cert_status)) {
@@ -81,7 +87,7 @@ ToolbarModel::SecurityLevel ToolbarModelImpl::GetSecurityLevelForWebContents(
content::CertStore::GetInstance()->RetrieveCert(ssl.cert_id, NULL))
return EV_SECURE;
return SECURE;
-
+ }
default:
NOTREACHED();
return NONE;
« no previous file with comments | « chrome/browser/profiles/profile_io_data.cc ('k') | chrome/browser/ui/website_settings/website_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698