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

Unified Diff: chrome/browser/android/url_utilities.cc

Issue 346753004: [Android] Expose more GoogleUtils to Java. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/UrlUtilities.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/url_utilities.cc
diff --git a/chrome/browser/android/url_utilities.cc b/chrome/browser/android/url_utilities.cc
index 364b0ccdf0113b8ffe8ce317d0bdacb5753fd10b..7167815f188576d37d075107f4aea4cba4e3e9a7 100644
--- a/chrome/browser/android/url_utilities.cc
+++ b/chrome/browser/android/url_utilities.cc
@@ -83,6 +83,21 @@ static jstring FixupUrl(JNIEnv* env,
NULL;
}
+static jboolean IsGooglePropertyUrl(JNIEnv* env, jclass clazz, jstring url) {
+ const GURL gurl = GURL(ConvertJavaStringToUTF8(env, url));
+ if (gurl.is_empty() || !gurl.is_valid())
+ return false;
+ return
+ google_util::IsGoogleDomainUrl(
+ gurl,
+ google_util::ALLOW_SUBDOMAIN,
+ google_util::DISALLOW_NON_STANDARD_PORTS) ||
+ google_util::IsYoutubeDomainUrl(
+ gurl,
+ google_util::ALLOW_SUBDOMAIN,
+ google_util::DISALLOW_NON_STANDARD_PORTS);
+}
+
// Register native methods
bool RegisterUrlUtilities(JNIEnv* env) {
return RegisterNativesImpl(env);
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/UrlUtilities.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698