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

Unified Diff: trunk/src/components/dom_distiller/content/web_contents_main_frame_observer.cc

Issue 297163003: Revert 272611 "Add support for distilling current WebContents" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 7 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: trunk/src/components/dom_distiller/content/web_contents_main_frame_observer.cc
===================================================================
--- trunk/src/components/dom_distiller/content/web_contents_main_frame_observer.cc (revision 272703)
+++ trunk/src/components/dom_distiller/content/web_contents_main_frame_observer.cc (working copy)
@@ -1,61 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/dom_distiller/content/web_contents_main_frame_observer.h"
-
-#include "content/public/browser/navigation_details.h"
-#include "content/public/browser/render_frame_host.h"
-#include "content/public/browser/web_contents.h"
-#include "content/public/browser/web_contents_observer.h"
-#include "content/public/browser/web_contents_user_data.h"
-
-DEFINE_WEB_CONTENTS_USER_DATA_KEY(dom_distiller::WebContentsMainFrameObserver);
-
-namespace dom_distiller {
-
-WebContentsMainFrameObserver::WebContentsMainFrameObserver(
- content::WebContents* web_contents)
- : is_document_loaded_in_main_frame_(false),
- is_initialized_(false),
- web_contents_(web_contents) {
- content::WebContentsObserver::Observe(web_contents);
-}
-
-WebContentsMainFrameObserver::~WebContentsMainFrameObserver() {
- CleanUp();
-}
-
-void WebContentsMainFrameObserver::DocumentLoadedInFrame(
- int64 frame_id,
- content::RenderViewHost* render_view_host) {
- if (web_contents_ &&
- frame_id == web_contents_->GetMainFrame()->GetRoutingID()) {
- is_document_loaded_in_main_frame_ = true;
- }
-}
-
-void WebContentsMainFrameObserver::DidNavigateMainFrame(
- const content::LoadCommittedDetails& details,
- const content::FrameNavigateParams& params) {
- if (details.is_main_frame) {
- is_document_loaded_in_main_frame_ = false;
- is_initialized_ = true;
- }
-}
-
-void WebContentsMainFrameObserver::RenderProcessGone(
- base::TerminationStatus status) {
- 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