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

Unified Diff: components/dom_distiller/content/browser/web_contents_main_frame_observer.cc

Issue 2663333004: Convert dom_distiller::WebContentsMainFrameObserver to use the new navigation callbacks. (Closed)
Patch Set: undo testing change Created 3 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: components/dom_distiller/content/browser/web_contents_main_frame_observer.cc
diff --git a/components/dom_distiller/content/browser/web_contents_main_frame_observer.cc b/components/dom_distiller/content/browser/web_contents_main_frame_observer.cc
index 51fd6906c221b9a860cd5f49b104d06bfaf1729d..d3e48c759e5bf38d6933dafb3c533c7c4ee0121d 100644
--- a/components/dom_distiller/content/browser/web_contents_main_frame_observer.cc
+++ b/components/dom_distiller/content/browser/web_contents_main_frame_observer.cc
@@ -4,7 +4,7 @@
#include "components/dom_distiller/content/browser/web_contents_main_frame_observer.h"
-#include "content/public/browser/navigation_details.h"
+#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
@@ -31,13 +31,16 @@ void WebContentsMainFrameObserver::DocumentLoadedInFrame(
}
}
-void WebContentsMainFrameObserver::DidNavigateMainFrame(
- const content::LoadCommittedDetails& details,
- const content::FrameNavigateParams& params) {
- if (details.is_navigation_to_different_page()) {
- is_document_loaded_in_main_frame_ = false;
- is_initialized_ = true;
+void WebContentsMainFrameObserver::DidFinishNavigation(
+ content::NavigationHandle* navigation_handle) {
+ if (!navigation_handle->IsInMainFrame() ||
+ !navigation_handle->HasCommitted() ||
+ navigation_handle->IsSamePage()) {
+ return;
}
+
+ is_document_loaded_in_main_frame_ = false;
+ is_initialized_ = true;
}
void WebContentsMainFrameObserver::RenderProcessGone(

Powered by Google App Engine
This is Rietveld 408576698