| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ssl/security_state_model_android.h" | 5 #include "chrome/browser/ssl/security_state_model_android.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/ssl/chrome_security_state_model_client.h" | 8 #include "chrome/browser/ssl/chrome_security_state_model_client.h" |
| 9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
| 10 #include "jni/SecurityStateModel_jni.h" | 10 #include "jni/SecurityStateModel_jni.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 content::WebContents::FromJavaWebContents(jweb_contents); | 25 content::WebContents::FromJavaWebContents(jweb_contents); |
| 26 DCHECK(web_contents); | 26 DCHECK(web_contents); |
| 27 ChromeSecurityStateModelClient::CreateForWebContents(web_contents); | 27 ChromeSecurityStateModelClient::CreateForWebContents(web_contents); |
| 28 ChromeSecurityStateModelClient* model_client = | 28 ChromeSecurityStateModelClient* model_client = |
| 29 ChromeSecurityStateModelClient::FromWebContents(web_contents); | 29 ChromeSecurityStateModelClient::FromWebContents(web_contents); |
| 30 DCHECK(model_client); | 30 DCHECK(model_client); |
| 31 security_state::SecurityStateModel::SecurityInfo security_info; | 31 security_state::SecurityStateModel::SecurityInfo security_info; |
| 32 model_client->GetSecurityInfo(&security_info); | 32 model_client->GetSecurityInfo(&security_info); |
| 33 return security_info.security_level; | 33 return security_info.security_level; |
| 34 } | 34 } |
| 35 | |
| 36 // static | |
| 37 jboolean IsDeprecatedSHA1Present(JNIEnv* env, | |
| 38 const JavaParamRef<jclass>& jcaller, | |
| 39 const JavaParamRef<jobject>& jweb_contents) { | |
| 40 content::WebContents* web_contents = | |
| 41 content::WebContents::FromJavaWebContents(jweb_contents); | |
| 42 DCHECK(web_contents); | |
| 43 ChromeSecurityStateModelClient::CreateForWebContents(web_contents); | |
| 44 ChromeSecurityStateModelClient* model_client = | |
| 45 ChromeSecurityStateModelClient::FromWebContents(web_contents); | |
| 46 DCHECK(model_client); | |
| 47 security_state::SecurityStateModel::SecurityInfo security_info; | |
| 48 model_client->GetSecurityInfo(&security_info); | |
| 49 return security_info.sha1_deprecation_status != | |
| 50 security_state::SecurityStateModel::NO_DEPRECATED_SHA1; | |
| 51 } | |
| 52 | |
| 53 // static | |
| 54 jboolean IsPassiveMixedContentPresent( | |
| 55 JNIEnv* env, | |
| 56 const JavaParamRef<jclass>& jcaller, | |
| 57 const JavaParamRef<jobject>& jweb_contents) { | |
| 58 content::WebContents* web_contents = | |
| 59 content::WebContents::FromJavaWebContents(jweb_contents); | |
| 60 DCHECK(web_contents); | |
| 61 ChromeSecurityStateModelClient::CreateForWebContents(web_contents); | |
| 62 ChromeSecurityStateModelClient* model_client = | |
| 63 ChromeSecurityStateModelClient::FromWebContents(web_contents); | |
| 64 DCHECK(model_client); | |
| 65 security_state::SecurityStateModel::SecurityInfo security_info; | |
| 66 model_client->GetSecurityInfo(&security_info); | |
| 67 return security_info.mixed_content_status == | |
| 68 security_state::SecurityStateModel::CONTENT_STATUS_DISPLAYED || | |
| 69 security_info.mixed_content_status == | |
| 70 security_state::SecurityStateModel:: | |
| 71 CONTENT_STATUS_DISPLAYED_AND_RAN; | |
| 72 } | |
| OLD | NEW |