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

Unified Diff: components/dom_distiller/content/distiller_page_web_contents_browsertest.cc

Issue 373623002: Convert remaining WebContentsObservers loading callbacks to use RFH. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix CrOS test Created 6 years, 5 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/distiller_page_web_contents_browsertest.cc
diff --git a/components/dom_distiller/content/distiller_page_web_contents_browsertest.cc b/components/dom_distiller/content/distiller_page_web_contents_browsertest.cc
index 884a75142baaaa076f20da55aaed3c146d709e40..7e7aa0210f7e291548abe2866eb71d8c4c3aaefc 100644
--- a/components/dom_distiller/content/distiller_page_web_contents_browsertest.cc
+++ b/components/dom_distiller/content/distiller_page_web_contents_browsertest.cc
@@ -131,11 +131,9 @@ class WebContentsMainFrameHelper : public content::WebContentsObserver {
WebContentsMainFrameHelper(content::WebContents* web_contents,
const base::Closure& callback,
bool wait_for_document_loaded)
- : web_contents_(web_contents),
+ : WebContentsObserver(web_contents),
callback_(callback),
- wait_for_document_loaded_(wait_for_document_loaded) {
- content::WebContentsObserver::Observe(web_contents);
- }
+ wait_for_document_loaded_(wait_for_document_loaded) {}
virtual void DidCommitProvisionalLoadForFrame(
content::RenderFrameHost* render_frame_host,
@@ -148,18 +146,14 @@ class WebContentsMainFrameHelper : public content::WebContentsObserver {
}
virtual void DocumentLoadedInFrame(
- int64 frame_id,
- content::RenderViewHost* render_view_host) OVERRIDE {
+ content::RenderFrameHost* render_frame_host) OVERRIDE {
if (wait_for_document_loaded_) {
- if (web_contents_ &&
- frame_id == web_contents_->GetMainFrame()->GetRoutingID()) {
+ if (!render_frame_host->GetParent())
callback_.Run();
- }
}
}
private:
- content::WebContents* web_contents_;
base::Closure callback_;
bool wait_for_document_loaded_;
};

Powered by Google App Engine
This is Rietveld 408576698