Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(527)

Side by Side Diff: chrome/browser/android/url_utilities.cc

Issue 1841653003: Drop |languages| from {Format,Elide}Url* and IDNToUnicode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typo in elide_url.cc Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 return false; 81 return false;
82 return google_util::IsGoogleSearchUrl(gurl); 82 return google_util::IsGoogleSearchUrl(gurl);
83 } 83 }
84 84
85 static ScopedJavaLocalRef<jstring> FormatUrlForSecurityDisplay( 85 static ScopedJavaLocalRef<jstring> FormatUrlForSecurityDisplay(
86 JNIEnv* env, 86 JNIEnv* env,
87 const JavaParamRef<jclass>& clazz, 87 const JavaParamRef<jclass>& clazz,
88 const JavaParamRef<jstring>& url) { 88 const JavaParamRef<jstring>& url) {
89 return base::android::ConvertUTF16ToJavaString( 89 return base::android::ConvertUTF16ToJavaString(
90 env, url_formatter::FormatUrlForSecurityDisplay( 90 env, url_formatter::FormatUrlForSecurityDisplay(
91 ConvertJavaStringToGURL(env, url), std::string())); 91 ConvertJavaStringToGURL(env, url)));
92 } 92 }
93 93
94 static ScopedJavaLocalRef<jstring> FormatUrlForSecurityDisplayOmitScheme( 94 static ScopedJavaLocalRef<jstring> FormatUrlForSecurityDisplayOmitScheme(
95 JNIEnv* env, 95 JNIEnv* env,
96 const JavaParamRef<jclass>& clazz, 96 const JavaParamRef<jclass>& clazz,
97 const JavaParamRef<jstring>& url) { 97 const JavaParamRef<jstring>& url) {
98 return base::android::ConvertUTF16ToJavaString( 98 return base::android::ConvertUTF16ToJavaString(
99 env, url_formatter::FormatUrlForSecurityDisplayOmitScheme( 99 env, url_formatter::FormatUrlForSecurityDisplayOmitScheme(
100 ConvertJavaStringToGURL(env, url), std::string())); 100 ConvertJavaStringToGURL(env, url)));
101 } 101 }
102 102
103 static jboolean IsGoogleHomePageUrl(JNIEnv* env, 103 static jboolean IsGoogleHomePageUrl(JNIEnv* env,
104 const JavaParamRef<jclass>& clazz, 104 const JavaParamRef<jclass>& clazz,
105 const JavaParamRef<jstring>& url) { 105 const JavaParamRef<jstring>& url) {
106 GURL gurl = ConvertJavaStringToGURL(env, url); 106 GURL gurl = ConvertJavaStringToGURL(env, url);
107 if (gurl.is_empty()) 107 if (gurl.is_empty())
108 return false; 108 return false;
109 return google_util::IsGoogleHomePageUrl(gurl); 109 return google_util::IsGoogleHomePageUrl(gurl);
110 } 110 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 return !gurl2.is_empty(); 153 return !gurl2.is_empty();
154 if (!gurl.is_valid() || !gurl2.is_valid()) 154 if (!gurl.is_valid() || !gurl2.is_valid())
155 return true; 155 return true;
156 return gurl.ref() != gurl2.ref(); 156 return gurl.ref() != gurl2.ref();
157 } 157 }
158 158
159 // Register native methods 159 // Register native methods
160 bool RegisterUrlUtilities(JNIEnv* env) { 160 bool RegisterUrlUtilities(JNIEnv* env) {
161 return RegisterNativesImpl(env); 161 return RegisterNativesImpl(env);
162 } 162 }
OLDNEW
« no previous file with comments | « chrome/browser/android/password_ui_view_android.cc ('k') | chrome/browser/autocomplete/in_memory_url_index_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698