| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "components/google/core/browser/google_util.h" | 9 #include "components/google/core/browser/google_util.h" |
| 10 #include "components/url_formatter/elide_url.h" | 10 #include "components/url_formatter/elide_url.h" |
| 11 #include "components/url_formatter/url_fixer.h" | 11 #include "components/url_formatter/url_fixer.h" |
| 12 #include "jni/UrlUtilities_jni.h" | 12 #include "jni/UrlUtilities_jni.h" |
| 13 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 13 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
| 14 #include "url/gurl.h" | 14 #include "url/gurl.h" |
| 15 | 15 |
| 16 using base::android::ConvertJavaStringToUTF8; | 16 using base::android::ConvertJavaStringToUTF8; |
| 17 using base::android::JavaParamRef; |
| 18 using base::android::ScopedJavaLocalRef; |
| 17 | 19 |
| 18 namespace { | 20 namespace { |
| 19 | 21 |
| 20 GURL ConvertJavaStringToGURL(JNIEnv*env, jstring url) { | 22 GURL ConvertJavaStringToGURL(JNIEnv*env, jstring url) { |
| 21 return url ? GURL(ConvertJavaStringToUTF8(env, url)) : GURL(); | 23 return url ? GURL(ConvertJavaStringToUTF8(env, url)) : GURL(); |
| 22 } | 24 } |
| 23 | 25 |
| 24 net::registry_controlled_domains::PrivateRegistryFilter GetRegistryFilter( | 26 net::registry_controlled_domains::PrivateRegistryFilter GetRegistryFilter( |
| 25 jboolean include_private) { | 27 jboolean include_private) { |
| 26 return include_private | 28 return include_private |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 return !gurl2.is_empty(); | 156 return !gurl2.is_empty(); |
| 155 if (!gurl.is_valid() || !gurl2.is_valid()) | 157 if (!gurl.is_valid() || !gurl2.is_valid()) |
| 156 return true; | 158 return true; |
| 157 return gurl.ref() != gurl2.ref(); | 159 return gurl.ref() != gurl2.ref(); |
| 158 } | 160 } |
| 159 | 161 |
| 160 // Register native methods | 162 // Register native methods |
| 161 bool RegisterUrlUtilities(JNIEnv* env) { | 163 bool RegisterUrlUtilities(JNIEnv* env) { |
| 162 return RegisterNativesImpl(env); | 164 return RegisterNativesImpl(env); |
| 163 } | 165 } |
| OLD | NEW |