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

Unified Diff: chrome/android/shell/java/src/org/chromium/chrome/shell/TestShellTab.java

Issue 189133005: Rename chromium_testshell target to chrome_shell_apk. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 9 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
Index: chrome/android/shell/java/src/org/chromium/chrome/shell/TestShellTab.java
diff --git a/chrome/android/shell/java/src/org/chromium/chrome/shell/TestShellTab.java b/chrome/android/shell/java/src/org/chromium/chrome/shell/TestShellTab.java
deleted file mode 100644
index 1464ed69c1123dca3b899029239a32291936f3c7..0000000000000000000000000000000000000000
--- a/chrome/android/shell/java/src/org/chromium/chrome/shell/TestShellTab.java
+++ /dev/null
@@ -1,124 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.chrome.shell;
-
-import android.content.Context;
-import android.text.TextUtils;
-
-import org.chromium.chrome.browser.Tab;
-import org.chromium.chrome.browser.UrlUtilities;
-import org.chromium.chrome.browser.contextmenu.ChromeContextMenuPopulator;
-import org.chromium.chrome.browser.contextmenu.ContextMenuPopulator;
-import org.chromium.chrome.browser.infobar.AutoLoginProcessor;
-import org.chromium.content.browser.ContentView;
-import org.chromium.content.browser.ContentViewClient;
-import org.chromium.content.browser.LoadUrlParams;
-import org.chromium.content_public.Referrer;
-import org.chromium.ui.base.WindowAndroid;
-
-/**
- * TestShell's implementation of a tab. This mirrors how Chrome for Android subclasses
- * and extends {@link Tab}.
- */
-public class TestShellTab extends Tab {
- // Tab state
- private boolean mIsLoading;
-
- /**
- * @param context The Context the view is running in.
- * @param url The URL to start this tab with.
- * @param window The WindowAndroid should represent this tab.
- * @param contentViewClient The client for the {@link ContentView}s of this Tab.
- */
- public TestShellTab(Context context, String url, WindowAndroid window,
- ContentViewClient contentViewClient) {
- super(false, context, window);
- initialize();
- initContentView();
- setContentViewClient(contentViewClient);
- loadUrlWithSanitization(url);
- }
-
- /**
- * @return Whether or not the tab is currently loading.
- */
- public boolean isLoading() {
- return mIsLoading;
- }
-
- /**
- * Navigates this Tab's {@link ContentView} to a sanitized version of {@code url}.
- * @param url The potentially unsanitized URL to navigate to.
- * @param postData Optional data to be sent via POST.
- */
- public void loadUrlWithSanitization(String url, byte[] postData) {
- if (url == null) return;
-
- // Sanitize the URL.
- url = UrlUtilities.fixupUrl(url);
-
- // Invalid URLs will just return empty.
- if (TextUtils.isEmpty(url)) return;
-
- ContentView contentView = getContentView();
- if (TextUtils.equals(url, contentView.getUrl())) {
- contentView.getContentViewCore().reload(true);
- } else {
- if (postData == null) {
- contentView.loadUrl(new LoadUrlParams(url));
- } else {
- contentView.loadUrl(LoadUrlParams.createLoadHttpPostParams(url, postData));
- }
- }
- }
-
- /**
- * 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) {
- loadUrlWithSanitization(url, null);
- }
-
- @Override
- protected TabChromeWebContentsDelegateAndroid createWebContentsDelegate() {
- return new TestShellTabChromeWebContentsDelegateAndroid();
- }
-
- @Override
- protected AutoLoginProcessor createAutoLoginProcessor() {
- return new AutoLoginProcessor() {
- @Override
- public void processAutoLoginResult(String accountName,
- String authToken, boolean success, String result) {
- getInfoBarContainer().processAutoLogin(accountName, authToken,
- success, result);
- }
- };
- }
-
- @Override
- protected ContextMenuPopulator createContextMenuPopulator() {
- return new ChromeContextMenuPopulator(new TabChromeContextMenuItemDelegate() {
- @Override
- public void onOpenImageUrl(String url, Referrer referrer) {
- loadUrlWithSanitization(url);
- }
- });
- }
-
- private class TestShellTabChromeWebContentsDelegateAndroid
- extends TabChromeWebContentsDelegateAndroid {
- @Override
- public void onLoadStarted() {
- mIsLoading = true;
- }
-
- @Override
- public void onLoadStopped() {
- mIsLoading = false;
- }
- }
-}

Powered by Google App Engine
This is Rietveld 408576698