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

Unified Diff: chrome/browser/dom_distiller/tab_utils.cc

Issue 2659953002: Convert SelfDeletingRequestDelegate to use the new navigation callbacks. (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dom_distiller/tab_utils.cc
diff --git a/chrome/browser/dom_distiller/tab_utils.cc b/chrome/browser/dom_distiller/tab_utils.cc
index 6f03d4fdaa3c882dcfaffc5b5495e329f1990a1a..1ea3c6990c6f6078e029095ae737d812e3c1f27f 100644
--- a/chrome/browser/dom_distiller/tab_utils.cc
+++ b/chrome/browser/dom_distiller/tab_utils.cc
@@ -20,6 +20,7 @@
#include "components/dom_distiller/core/url_utils.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/navigation_controller.h"
+#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
@@ -49,9 +50,8 @@ class SelfDeletingRequestDelegate : public ViewRequestDelegate,
void OnArticleUpdated(ArticleDistillationUpdate article_update) override;
// content::WebContentsObserver implementation.
- void DidNavigateMainFrame(
- const content::LoadCommittedDetails& details,
- const content::FrameNavigateParams& params) override;
+ void DidFinishNavigation(
+ content::NavigationHandle* navigation_handle) override;
void RenderProcessGone(base::TerminationStatus status) override;
void WebContentsDestroyed() override;
@@ -65,9 +65,11 @@ class SelfDeletingRequestDelegate : public ViewRequestDelegate,
std::unique_ptr<ViewerHandle> viewer_handle_;
};
-void SelfDeletingRequestDelegate::DidNavigateMainFrame(
- const content::LoadCommittedDetails& details,
- const content::FrameNavigateParams& params) {
+void SelfDeletingRequestDelegate::DidFinishNavigation(
+ content::NavigationHandle* navigation_handle) {
+ if (!navigation_handle->IsInMainFrame() || !navigation_handle->HasCommitted())
+ return;
+
Observe(NULL);
base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698