blob: aa6ad8e26f15305761accd1fd6e6840e122adfcf [file] [log] [blame]
// Copyright 2017 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/payments/ssl_validity_checker.h"
#include "base/logging.h"
#include "chrome/browser/ssl/security_state_tab_helper.h"
#include "components/security_state/core/security_state.h"
namespace payments {
// static
bool SslValidityChecker::IsSslCertificateValid(
content::WebContents* web_contents) {
DCHECK(web_contents);
SecurityStateTabHelper::CreateForWebContents(web_contents);
SecurityStateTabHelper* helper =
SecurityStateTabHelper::FromWebContents(web_contents);
DCHECK(helper);
security_state::SecurityLevel security_level = helper->GetSecurityLevel();
return security_level == security_state::EV_SECURE ||
security_level == security_state::SECURE ||
security_level == security_state::SECURE_WITH_POLICY_INSTALLED_CERT;
}
} // namespace payments