Skip to content

Commit

Permalink
Convert Distiller browser test to use the new navigation callbacks.
Browse files Browse the repository at this point in the history
BUG=682002

Review-Url: https://codereview.chromium.org/2650653008
Cr-Commit-Position: refs/heads/master@{#446519}
  • Loading branch information
jam authored and Commit bot committed Jan 27, 2017
1 parent fe5277a commit ec320f4
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "components/dom_distiller/core/viewer.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/render_frame_host.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/common/isolated_world_ids.h"
Expand Down Expand Up @@ -55,13 +56,11 @@ class WebContentsMainFrameHelper : public content::WebContentsObserver {
callback_(callback),
wait_for_document_loaded_(wait_for_document_loaded) {}

void DidCommitProvisionalLoadForFrame(
content::RenderFrameHost* render_frame_host,
const GURL& url,
ui::PageTransition transition_type) override {
void DidFinishNavigation(
content::NavigationHandle* navigation_handle) override {
if (wait_for_document_loaded_)
return;
if (!render_frame_host->GetParent())
if (navigation_handle->HasCommitted() && navigation_handle->IsInMainFrame())
callback_.Run();
}

Expand Down

0 comments on commit ec320f4

Please sign in to comment.