OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/payments/ssl_validity_checker.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "chrome/browser/ssl/security_state_tab_helper.h" |
| 9 #include "components/security_state/core/security_state.h" |
| 10 |
| 11 namespace payments { |
| 12 |
| 13 // static |
| 14 bool SslValidityChecker::IsSslCertificateValid( |
| 15 content::WebContents* web_contents) { |
| 16 DCHECK(web_contents); |
| 17 SecurityStateTabHelper::CreateForWebContents(web_contents); |
| 18 SecurityStateTabHelper* helper = |
| 19 SecurityStateTabHelper::FromWebContents(web_contents); |
| 20 DCHECK(helper); |
| 21 security_state::SecurityInfo security_info; |
| 22 helper->GetSecurityInfo(&security_info); |
| 23 return security_info.security_level == security_state::EV_SECURE || |
| 24 security_info.security_level == security_state::SECURE || |
| 25 security_info.security_level == |
| 26 security_state::SECURE_WITH_POLICY_INSTALLED_CERT; |
| 27 } |
| 28 |
| 29 } // namespace payments |
OLD | NEW |