| 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 package org.chromium.chrome.browser; | 5 package org.chromium.chrome.browser; |
| 6 | 6 |
| 7 import android.text.TextUtils; | 7 import android.text.TextUtils; |
| 8 | 8 |
| 9 import org.chromium.base.CollectionUtil; | 9 import org.chromium.base.CollectionUtil; |
| 10 import org.chromium.base.Log; | 10 import org.chromium.base.Log; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 /** | 119 /** |
| 120 * @param uri A URI. | 120 * @param uri A URI. |
| 121 * | 121 * |
| 122 * @return Whether the URI's scheme is for a internal chrome page. | 122 * @return Whether the URI's scheme is for a internal chrome page. |
| 123 */ | 123 */ |
| 124 public static boolean isInternalScheme(URI uri) { | 124 public static boolean isInternalScheme(URI uri) { |
| 125 return INTERNAL_SCHEMES.contains(uri.getScheme()); | 125 return INTERNAL_SCHEMES.contains(uri.getScheme()); |
| 126 } | 126 } |
| 127 | 127 |
| 128 /** | 128 /** |
| 129 * Refer to url_fixer::FixupURL. | 129 * Refer to url_formatter::FixupURL. |
| 130 * | 130 * |
| 131 * Given a URL-like string, returns a real URL or null. For example: | 131 * Given a URL-like string, returns a real URL or null. For example: |
| 132 * - "google.com" -> "http://google.com/" | 132 * - "google.com" -> "http://google.com/" |
| 133 * - "about:" -> "chrome://version/" | 133 * - "about:" -> "chrome://version/" |
| 134 * - "//mail.google.com:/" -> "file:///mail.google.com:/" | 134 * - "//mail.google.com:/" -> "file:///mail.google.com:/" |
| 135 * - "..." -> null | 135 * - "..." -> null |
| 136 */ | 136 */ |
| 137 public static String fixupUrl(String uri) { | 137 public static String fixupUrl(String uri) { |
| 138 if (TextUtils.isEmpty(uri)) return null; | 138 if (TextUtils.isEmpty(uri)) return null; |
| 139 return nativeFixupUrl(uri, null); | 139 return nativeFixupUrl(uri, null); |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 } | 375 } |
| 376 | 376 |
| 377 private static native boolean nativeSameDomainOrHost(String primaryUrl, Stri
ng secondaryUrl, | 377 private static native boolean nativeSameDomainOrHost(String primaryUrl, Stri
ng secondaryUrl, |
| 378 boolean includePrivateRegistries); | 378 boolean includePrivateRegistries); |
| 379 private static native String nativeGetDomainAndRegistry(String url, | 379 private static native String nativeGetDomainAndRegistry(String url, |
| 380 boolean includePrivateRegistries); | 380 boolean includePrivateRegistries); |
| 381 public static native boolean nativeIsGoogleSearchUrl(String url); | 381 public static native boolean nativeIsGoogleSearchUrl(String url); |
| 382 public static native boolean nativeIsGoogleHomePageUrl(String url); | 382 public static native boolean nativeIsGoogleHomePageUrl(String url); |
| 383 private static native String nativeFixupUrl(String url, String desiredTld); | 383 private static native String nativeFixupUrl(String url, String desiredTld); |
| 384 } | 384 } |
| OLD | NEW |