Index: chrome/browser/android/url_utilities.cc |
diff --git a/chrome/browser/android/url_utilities.cc b/chrome/browser/android/url_utilities.cc |
index a82902548bc096f966e6fd9fa74f988802f1ca15..27c9ed4306538f392b9489e8a57add62e28f7caa 100644 |
--- a/chrome/browser/android/url_utilities.cc |
+++ b/chrome/browser/android/url_utilities.cc |
@@ -2,9 +2,12 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+#include <string> |
+ |
#include "base/android/jni_android.h" |
#include "base/android/jni_string.h" |
#include "components/google/core/browser/google_util.h" |
+#include "components/url_formatter/elide_url.h" |
#include "components/url_formatter/url_fixer.h" |
#include "jni/UrlUtilities_jni.h" |
#include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
@@ -70,6 +73,24 @@ static jboolean IsGoogleSearchUrl(JNIEnv* env, |
return google_util::IsGoogleSearchUrl(gurl); |
} |
+static ScopedJavaLocalRef<jstring> FormatUrlForSecurityDisplay( |
+ JNIEnv* env, |
+ const JavaParamRef<jclass>& clazz, |
+ const JavaParamRef<jstring>& url) { |
+ return base::android::ConvertUTF16ToJavaString( |
+ env, url_formatter::FormatUrlForSecurityDisplay( |
+ ConvertJavaStringToGURL(env, url), std::string())); |
+} |
+ |
+static ScopedJavaLocalRef<jstring> FormatUrlForSecurityDisplayOmitScheme( |
+ JNIEnv* env, |
+ const JavaParamRef<jclass>& clazz, |
+ const JavaParamRef<jstring>& url) { |
+ return base::android::ConvertUTF16ToJavaString( |
+ env, url_formatter::FormatUrlForSecurityDisplayOmitScheme( |
+ ConvertJavaStringToGURL(env, url), std::string())); |
+} |
+ |
static jboolean IsGoogleHomePageUrl(JNIEnv* env, |
const JavaParamRef<jclass>& clazz, |
const JavaParamRef<jstring>& url) { |