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 "components/payments/content/android/origin_security_checker_android.h" |
| 6 |
| 7 #include "base/android/jni_string.h" |
| 8 #include "base/android/scoped_java_ref.h" |
| 9 #include "components/payments/content/origin_security_checker.h" |
| 10 #include "content/public/browser/web_contents.h" |
| 11 #include "jni/OriginSecurityChecker_jni.h" |
| 12 |
| 13 namespace payments { |
| 14 namespace { |
| 15 |
| 16 using ::base::android::JavaParamRef; |
| 17 using ::base::android::ConvertJavaStringToUTF8; |
| 18 |
| 19 } // namespace |
| 20 |
| 21 // static |
| 22 jboolean IsOriginSecure(JNIEnv* env, |
| 23 const JavaParamRef<jclass>& jcaller, |
| 24 const JavaParamRef<jstring>& jurl) { |
| 25 return OriginSecurityChecker::IsOriginSecure( |
| 26 GURL(ConvertJavaStringToUTF8(env, jurl))); |
| 27 } |
| 28 |
| 29 // static |
| 30 jboolean IsSchemeCryptographic(JNIEnv* env, |
| 31 const JavaParamRef<jclass>& jcaller, |
| 32 const JavaParamRef<jstring>& jurl) { |
| 33 return OriginSecurityChecker::IsSchemeCryptographic( |
| 34 GURL(ConvertJavaStringToUTF8(env, jurl))); |
| 35 } |
| 36 |
| 37 bool RegisterOriginSecurityChecker(JNIEnv* env) { |
| 38 return RegisterNativesImpl(env); |
| 39 } |
| 40 |
| 41 } // namespace payments |
OLD | NEW |