コード例 #1
0
ファイル: Shell.java プロジェクト: johnnycrab/chromium.src
  /**
   * Loads an URL. This will perform minimal amounts of sanitizing of the URL to attempt to make it
   * valid.
   *
   * @param url The URL to be loaded by the shell.
   */
  public void loadUrl(String url) {
    if (url == null) return;

    if (TextUtils.equals(url, mContentView.getUrl())) {
      mContentView.reload();
    } else {
      mContentView.loadUrl(new LoadUrlParams(sanitizeUrl(url)));
    }
    mUrlTextView.clearFocus();
  }
コード例 #2
0
ファイル: TabBase.java プロジェクト: EQ4/h5vcc
  /**
   * Navigates this Tab's {@link ContentView} to a sanitized version of {@code url}.
   *
   * @param url The potentially unsanitized URL to navigate to.
   */
  public void loadUrlWithSanitization(String url) {
    if (url == null) return;

    // Sanitize the URL.
    url = nativeFixupUrl(mNativeTabBaseAndroidImpl, url);

    // Invalid URLs will just return empty.
    if (TextUtils.isEmpty(url)) return;

    if (TextUtils.equals(url, mContentView.getUrl())) {
      mContentView.reload();
    } else {
      mContentView.loadUrl(new LoadUrlParams(url));
    }
  }