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

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

Issue 2642303002: PlzNavigate: Chrome UI changes for new methods of WebContentsObserver (Closed)
Patch Set: undo changes for error description Created 3 years, 10 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/dom_distiller/ReaderModeManager.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/ReaderModeManager.java b/chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/ReaderModeManager.java
index dde1407799026c24823577eb68948f6a91dd86bd..d31e3efe2d0b37f461f1fd3fc626bfe17ad2c662 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/ReaderModeManager.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/ReaderModeManager.java
@@ -440,9 +440,9 @@ public class ReaderModeManager extends TabModelSelectorTabObserver
return new WebContentsObserver(webContents) {
@Override
- public void didStartProvisionalLoadForFrame(long frameId, long parentFrameId,
- boolean isMainFrame, String validatedUrl, boolean isErrorPage) {
- if (!isMainFrame) return;
+ public void didStartNavigation(
+ String url, boolean isInMainFrame, boolean isSamePage, boolean isErrorPage) {
+ if (!isInMainFrame || isSamePage) return;
// If there is a navigation in the current tab, hide the bar. It will show again
// once the distillability test is successful.
if (readerTabId == mTabModelSelector.getCurrentTabId()) {
@@ -453,20 +453,21 @@ public class ReaderModeManager extends TabModelSelectorTabObserver
ReaderModeTabInfo tabInfo = mTabStatusMap.get(readerTabId);
if (tabInfo == null) return;
- tabInfo.setUrl(validatedUrl);
- if (DomDistillerUrlUtils.isDistilledPage(validatedUrl)) {
+ tabInfo.setUrl(url);
+ if (DomDistillerUrlUtils.isDistilledPage(url)) {
tabInfo.setStatus(STARTED);
- mReaderModePageUrl = validatedUrl;
+ mReaderModePageUrl = url;
}
}
@Override
- public void didNavigateMainFrame(String url, String baseUrl,
- boolean isNavigationToDifferentPage, boolean isNavigationInPage,
- int statusCode) {
+ public void didFinishNavigation(String url, boolean isInMainFrame, boolean isErrorPage,
+ boolean hasCommitted, boolean isSamePage, boolean isFragmentNavigation,
+ Integer pageTransition, int errorCode, String errorDescription,
+ int httpStatusCode) {
// TODO(cjhopman): This should possibly ignore navigations that replace the entry
// (like those from history.replaceState()).
- if (isNavigationInPage) return;
+ if (!hasCommitted || !isInMainFrame || isSamePage) return;
if (DomDistillerUrlUtils.isDistilledPage(url)) return;
// Make sure the tab was not destroyed.

Powered by Google App Engine
This is Rietveld 408576698