| 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 10 matching lines...) Expand all Loading... |
| 21 JNIEnv* env, | 21 JNIEnv* env, |
| 22 const JavaParamRef<jclass>& jcaller, | 22 const JavaParamRef<jclass>& jcaller, |
| 23 const JavaParamRef<jobject>& jweb_contents) { | 23 const JavaParamRef<jobject>& jweb_contents) { |
| 24 content::WebContents* web_contents = | 24 content::WebContents* web_contents = |
| 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 return model_client->GetSecurityInfo().security_level; | 31 security_state::SecurityStateModel::SecurityInfo security_info; |
| 32 model_client->GetSecurityInfo(&security_info); |
| 33 return security_info.security_level; |
| 32 } | 34 } |
| 33 | 35 |
| 34 // static | 36 // static |
| 35 jboolean IsDeprecatedSHA1Present(JNIEnv* env, | 37 jboolean IsDeprecatedSHA1Present(JNIEnv* env, |
| 36 const JavaParamRef<jclass>& jcaller, | 38 const JavaParamRef<jclass>& jcaller, |
| 37 const JavaParamRef<jobject>& jweb_contents) { | 39 const JavaParamRef<jobject>& jweb_contents) { |
| 38 content::WebContents* web_contents = | 40 content::WebContents* web_contents = |
| 39 content::WebContents::FromJavaWebContents(jweb_contents); | 41 content::WebContents::FromJavaWebContents(jweb_contents); |
| 40 DCHECK(web_contents); | 42 DCHECK(web_contents); |
| 41 ChromeSecurityStateModelClient::CreateForWebContents(web_contents); | 43 ChromeSecurityStateModelClient::CreateForWebContents(web_contents); |
| 42 ChromeSecurityStateModelClient* model_client = | 44 ChromeSecurityStateModelClient* model_client = |
| 43 ChromeSecurityStateModelClient::FromWebContents(web_contents); | 45 ChromeSecurityStateModelClient::FromWebContents(web_contents); |
| 44 DCHECK(model_client); | 46 DCHECK(model_client); |
| 45 return model_client->GetSecurityInfo().sha1_deprecation_status != | 47 security_state::SecurityStateModel::SecurityInfo security_info; |
| 48 model_client->GetSecurityInfo(&security_info); |
| 49 return security_info.sha1_deprecation_status != |
| 46 security_state::SecurityStateModel::NO_DEPRECATED_SHA1; | 50 security_state::SecurityStateModel::NO_DEPRECATED_SHA1; |
| 47 } | 51 } |
| 48 | 52 |
| 49 // static | 53 // static |
| 50 jboolean IsPassiveMixedContentPresent( | 54 jboolean IsPassiveMixedContentPresent( |
| 51 JNIEnv* env, | 55 JNIEnv* env, |
| 52 const JavaParamRef<jclass>& jcaller, | 56 const JavaParamRef<jclass>& jcaller, |
| 53 const JavaParamRef<jobject>& jweb_contents) { | 57 const JavaParamRef<jobject>& jweb_contents) { |
| 54 content::WebContents* web_contents = | 58 content::WebContents* web_contents = |
| 55 content::WebContents::FromJavaWebContents(jweb_contents); | 59 content::WebContents::FromJavaWebContents(jweb_contents); |
| 56 DCHECK(web_contents); | 60 DCHECK(web_contents); |
| 57 ChromeSecurityStateModelClient::CreateForWebContents(web_contents); | 61 ChromeSecurityStateModelClient::CreateForWebContents(web_contents); |
| 58 ChromeSecurityStateModelClient* model_client = | 62 ChromeSecurityStateModelClient* model_client = |
| 59 ChromeSecurityStateModelClient::FromWebContents(web_contents); | 63 ChromeSecurityStateModelClient::FromWebContents(web_contents); |
| 60 DCHECK(model_client); | 64 DCHECK(model_client); |
| 61 return model_client->GetSecurityInfo().mixed_content_status == | 65 security_state::SecurityStateModel::SecurityInfo security_info; |
| 66 model_client->GetSecurityInfo(&security_info); |
| 67 return security_info.mixed_content_status == |
| 62 security_state::SecurityStateModel::CONTENT_STATUS_DISPLAYED || | 68 security_state::SecurityStateModel::CONTENT_STATUS_DISPLAYED || |
| 63 model_client->GetSecurityInfo().mixed_content_status == | 69 security_info.mixed_content_status == |
| 64 security_state::SecurityStateModel:: | 70 security_state::SecurityStateModel:: |
| 65 CONTENT_STATUS_DISPLAYED_AND_RAN; | 71 CONTENT_STATUS_DISPLAYED_AND_RAN; |
| 66 } | 72 } |
| OLD | NEW |