summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-25 19:24:47 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-25 19:24:47 +0000
commit2e3f45720cf36a92af6626a42ae42dd08974c300 (patch)
treea6d5cd8b9ea6753d3a444ea68e4ab1c153a684e9 /content
parent160d5f66f97488dc1d1c4515150394bdb8c1ef3c (diff)
downloadchromium_src-2e3f45720cf36a92af6626a42ae42dd08974c300.zip
chromium_src-2e3f45720cf36a92af6626a42ae42dd08974c300.tar.gz
chromium_src-2e3f45720cf36a92af6626a42ae42dd08974c300.tar.bz2
Cleanup: Move the last bits of chrome printing code out of content/.
BUG=76795 TEST=none Review URL: http://codereview.chromium.org/6731034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79436 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/DEPS5
-rw-r--r--content/browser/tab_contents/tab_contents.cc10
-rw-r--r--content/browser/tab_contents/tab_contents.h8
-rw-r--r--content/browser/tab_contents/tab_contents_observer.cc6
-rw-r--r--content/browser/tab_contents/tab_contents_observer.h4
5 files changed, 17 insertions, 16 deletions
diff --git a/content/DEPS b/content/DEPS
index f815d36..90779ea 100644
--- a/content/DEPS
+++ b/content/DEPS
@@ -7,7 +7,10 @@ include_rules = [
# When the src\content refactoring is complete, this will be unnecessary (and
# in fact, a layering violation).
"+chrome",
-
+ # The following directories have been refactored, so no new dependencies
+ # should be added from these directories.
+ "-chrome/browser/printing",
+
# The subdirectories in content/ will manually allow their own include
# directories in content/ so we disallow all of them.
"-content",
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
index 585faa5..fe6e82e 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -40,7 +40,6 @@
#include "chrome/browser/pdf_unsupported_feature.h"
#include "chrome/browser/platform_util.h"
#include "chrome/browser/plugin_observer.h"
-#include "chrome/browser/printing/print_view_manager.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_host/web_cache_manager.h"
#include "chrome/browser/renderer_preferences_util.h"
@@ -379,7 +378,6 @@ TabContents::~TabContents() {
}
void TabContents::AddObservers() {
- printing_.reset(new printing::PrintViewManager(this));
favicon_helper_.reset(new FaviconHelper(this));
desktop_notification_handler_.reset(
new DesktopNotificationHandlerForTC(this, GetRenderProcessHost()));
@@ -779,7 +777,7 @@ bool TabContents::NavigateToEntry(
void TabContents::Stop() {
render_manager_.Stop();
- printing_->Stop();
+ FOR_EACH_OBSERVER(TabContentsObserver, observers_, StopNavigation());
}
void TabContents::DisassociateFromPopupCount() {
@@ -2040,14 +2038,14 @@ void TabContents::RenderViewReady(RenderViewHost* rvh) {
void TabContents::RenderViewGone(RenderViewHost* rvh,
base::TerminationStatus status,
int error_code) {
- // Ask the print preview if this renderer was valuable.
- if (!printing_->OnRenderViewGone(rvh))
- return;
if (rvh != render_view_host()) {
// The pending page's RenderViewHost is gone.
return;
}
+ // Let observers know first and give them a chance to act.
+ FOR_EACH_OBSERVER(TabContentsObserver, observers_, RenderViewGone());
+
SetIsLoading(false, NULL);
NotifyDisconnected();
SetIsCrashed(status, error_code);
diff --git a/content/browser/tab_contents/tab_contents.h b/content/browser/tab_contents/tab_contents.h
index 255356e..7b01d3a 100644
--- a/content/browser/tab_contents/tab_contents.h
+++ b/content/browser/tab_contents/tab_contents.h
@@ -55,11 +55,6 @@ namespace prerender {
class PrerenderManager;
}
-namespace printing {
-class PrintPreviewMessageHandler;
-class PrintViewManager;
-}
-
namespace safe_browsing {
class ClientSideDetectionHost;
}
@@ -1035,9 +1030,6 @@ class TabContents : public PageNavigator,
// Registers and unregisters for pref notifications.
PrefChangeRegistrar pref_change_registrar_;
- // Handles print job for this contents.
- scoped_ptr<printing::PrintViewManager> printing_;
-
// SavePackage, lazily created.
scoped_refptr<SavePackage> save_package_;
diff --git a/content/browser/tab_contents/tab_contents_observer.cc b/content/browser/tab_contents/tab_contents_observer.cc
index f0cb48c3..1a5c3c3 100644
--- a/content/browser/tab_contents/tab_contents_observer.cc
+++ b/content/browser/tab_contents/tab_contents_observer.cc
@@ -29,6 +29,12 @@ void TabContentsObserver::DidStartLoading() {
void TabContentsObserver::DidStopLoading() {
}
+void TabContentsObserver::RenderViewGone() {
+}
+
+void TabContentsObserver::StopNavigation() {
+}
+
TabContentsObserver::TabContentsObserver(TabContents* tab_contents)
: tab_contents_(tab_contents),
routing_id_(tab_contents->render_view_host()->routing_id()) {
diff --git a/content/browser/tab_contents/tab_contents_observer.h b/content/browser/tab_contents/tab_contents_observer.h
index 36b9f40..899fcf7 100644
--- a/content/browser/tab_contents/tab_contents_observer.h
+++ b/content/browser/tab_contents/tab_contents_observer.h
@@ -26,6 +26,8 @@ class TabContentsObserver : public IPC::Channel::Listener {
virtual void DidStartLoading();
virtual void DidStopLoading();
+ virtual void RenderViewGone();
+ virtual void StopNavigation();
#if 0
// For unifying with delegate...
@@ -43,7 +45,7 @@ class TabContentsObserver : public IPC::Channel::Listener {
#endif
protected:
- TabContentsObserver(TabContents* tab_contents);
+ explicit TabContentsObserver(TabContents* tab_contents);
virtual ~TabContentsObserver();
// Invoked when the TabContents is being destroyed. Gives subclasses a chance