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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/Tab.java

Issue 877163005: [Android] Fix new tab not to show 'about:blank' at the beginning (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added comments Created 5 years, 11 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/java/src/org/chromium/chrome/browser/Tab.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/Tab.java b/chrome/android/java/src/org/chromium/chrome/browser/Tab.java
index 5091dccfc0f094072c2e25a5e3868816c8e5ef91..4ceafc18f3302f89acc6dafbcb3bc4c4ed12efe6 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/Tab.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/Tab.java
@@ -49,6 +49,7 @@ import org.chromium.content.browser.ContentViewClient;
import org.chromium.content.browser.ContentViewCore;
import org.chromium.content.browser.WebContentsObserver;
import org.chromium.content_public.browser.LoadUrlParams;
+import org.chromium.content_public.browser.NavigationController;
import org.chromium.content_public.browser.WebContents;
import org.chromium.content_public.common.Referrer;
import org.chromium.content_public.common.TopControlsState;
@@ -578,6 +579,13 @@ public class Tab implements ViewGroup.OnHierarchyChangeListener,
observer.onDidDetachInterstitialPage(Tab.this);
}
}
+
+ @Override
+ public void didStartNavigationToPendingEntry(String url, int reloadType) {
+ for (TabObserver observer : mObservers) {
+ observer.onDidStartNavigationToPendingEntry(Tab.this, url, reloadType);
+ }
+ }
}
/**
@@ -2268,6 +2276,19 @@ public class Tab implements ViewGroup.OnHierarchyChangeListener,
if (view != null) view.requestFocus();
}
+ /**
+ * Check whether the current navigation entry is initial, meaning whether it has
+ * the same target URL as the initial URL of the tab.
+ * @return Whether the current navigation entry is initial.
+ */
+ public boolean isCurrentNavigationEntryInitial() {
Ted C 2015/01/29 21:42:08 I wouldn't add this here. It's just is a helper f
Changwan Ryu 2015/01/30 00:03:24 Done.
+ WebContents webContents = getWebContents();
+ if (webContents == null) return false;
+ NavigationController navigationController = webContents.getNavigationController();
+ if (navigationController == null) return false;
+ return navigationController.isInitialNavigation();
+ }
+
@CalledByNative
protected void openNewTab(String url, String extraHeaders, byte[] postData, int disposition,
boolean hasParent, boolean isRendererInitiated) {

Powered by Google App Engine
This is Rietveld 408576698