| Index: chrome/browser/ssl/chrome_security_state_model_client.cc
|
| diff --git a/chrome/browser/ssl/chrome_security_state_model_client.cc b/chrome/browser/ssl/chrome_security_state_model_client.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..b95f8865faac7ba590cf4e10ee9e2c7464472cfe
|
| --- /dev/null
|
| +++ b/chrome/browser/ssl/chrome_security_state_model_client.cc
|
| @@ -0,0 +1,44 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "chrome/browser/ssl/chrome_security_state_model_client.h"
|
| +
|
| +#include "base/command_line.h"
|
| +#include "base/metrics/field_trial.h"
|
| +#include "base/metrics/histogram_macros.h"
|
| +#include "chrome/browser/chromeos/policy/policy_cert_service.h"
|
| +#include "chrome/browser/chromeos/policy/policy_cert_service_factory.h"
|
| +#include "chrome/browser/profiles/profile.h"
|
| +#include "content/public/browser/cert_store.h"
|
| +#include "content/public/browser/navigation_entry.h"
|
| +#include "content/public/browser/web_contents.h"
|
| +#include "content/public/common/ssl_status.h"
|
| +#include "net/cert/x509_certificate.h"
|
| +
|
| +ChromeSecurityStateModelClient::ChromeSecurityStateModelClient(
|
| + content::WebContents* web_contents)
|
| + : web_contents_(web_contents) {}
|
| +
|
| +ChromeSecurityStateModelClient::~ChromeSecurityStateModelClient() {}
|
| +
|
| +bool ChromeSecurityStateModelClient::RetrieveCert(
|
| + scoped_refptr<net::X509Certificate>* cert) {
|
| + content::NavigationEntry* entry =
|
| + web_contents_->GetController().GetVisibleEntry();
|
| + if (!entry)
|
| + return false;
|
| + return content::CertStore::GetInstance()->RetrieveCert(
|
| + entry->GetSSL().cert_id, cert);
|
| +}
|
| +
|
| +bool ChromeSecurityStateModelClient::UsedPolicyInstalledCertificate() {
|
| +#if defined(OS_CHROMEOS)
|
| + policy::PolicyCertService* service =
|
| + policy::PolicyCertServiceFactory::GetForProfile(
|
| + Profile::FromBrowserContext(web_contents_->GetBrowserContext()));
|
| + if (service && service->UsedPolicyCertificates())
|
| + return true;
|
| +#endif
|
| + return false;
|
| +}
|
|
|