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

Unified Diff: components/dom_distiller/content/web_contents_main_frame_observer.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/web_contents_main_frame_observer.cc
diff --git a/components/dom_distiller/content/web_contents_main_frame_observer.cc b/components/dom_distiller/content/web_contents_main_frame_observer.cc
index ed1bbab54913297f32b046d9b02ff7f8bfdcaa22..92ea4b9c8214c9391734ff076bad7e4f400c2e4e 100644
--- a/components/dom_distiller/content/web_contents_main_frame_observer.cc
+++ b/components/dom_distiller/content/web_contents_main_frame_observer.cc
@@ -16,9 +16,7 @@ namespace dom_distiller {
WebContentsMainFrameObserver::WebContentsMainFrameObserver(
content::WebContents* web_contents)
- : is_document_loaded_in_main_frame_(false),
- is_initialized_(false),
- web_contents_(web_contents) {
+ : is_document_loaded_in_main_frame_(false), is_initialized_(false) {
content::WebContentsObserver::Observe(web_contents);
}
@@ -27,10 +25,8 @@ WebContentsMainFrameObserver::~WebContentsMainFrameObserver() {
}
void WebContentsMainFrameObserver::DocumentLoadedInFrame(
- int64 frame_id,
- content::RenderViewHost* render_view_host) {
- if (web_contents_ &&
- frame_id == web_contents_->GetMainFrame()->GetRoutingID()) {
+ content::RenderFrameHost* render_frame_host) {
+ if (!render_frame_host->GetParent()) {
is_document_loaded_in_main_frame_ = true;
}
}
@@ -49,13 +45,8 @@ void WebContentsMainFrameObserver::RenderProcessGone(
CleanUp();
}
-void WebContentsMainFrameObserver::WebContentsDestroyed() {
- CleanUp();
-}
-
void WebContentsMainFrameObserver::CleanUp() {
content::WebContentsObserver::Observe(NULL);
- web_contents_ = NULL;
}
} // namespace dom_distiller

Powered by Google App Engine
This is Rietveld 408576698