summaryrefslogtreecommitdiffstats
path: root/chrome/browser/printing
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-09 22:00:21 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-09 22:00:21 +0000
commit8d3347feb74ff61582d42b214365664ecc41c775 (patch)
tree300f42cdb3c7f0de84241fa72b8e8e07735e7cc1 /chrome/browser/printing
parent8f27da1f873a11a7900ef2735967cec1a2291a79 (diff)
downloadchromium_src-8d3347feb74ff61582d42b214365664ecc41c775.zip
chromium_src-8d3347feb74ff61582d42b214365664ecc41c775.tar.gz
chromium_src-8d3347feb74ff61582d42b214365664ecc41c775.tar.bz2
Move some more interfaces on RenderViewHostDelegate to separate classes. The
ones in the patch are those that are implemented by other classes, avoiding TabContents pass-throughs. Review URL: http://codereview.chromium.org/149373 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20324 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/printing')
-rw-r--r--chrome/browser/printing/print_view_manager.cc30
-rw-r--r--chrome/browser/printing/print_view_manager.h16
2 files changed, 22 insertions, 24 deletions
diff --git a/chrome/browser/printing/print_view_manager.cc b/chrome/browser/printing/print_view_manager.cc
index d1040b2..6121cb2 100644
--- a/chrome/browser/printing/print_view_manager.cc
+++ b/chrome/browser/printing/print_view_manager.cc
@@ -56,6 +56,21 @@ bool PrintViewManager::OnRenderViewGone(RenderViewHost* render_view_host) {
return true;
}
+std::wstring PrintViewManager::RenderSourceName() {
+ std::wstring name(UTF16ToWideHack(owner_.GetTitle()));
+ if (name.empty())
+ name = l10n_util::GetString(IDS_DEFAULT_PRINT_DOCUMENT_TITLE);
+ return name;
+}
+
+GURL PrintViewManager::RenderSourceUrl() {
+ NavigationEntry* entry = owner_.controller().GetActiveEntry();
+ if (entry)
+ return entry->display_url();
+ else
+ return GURL();
+}
+
void PrintViewManager::DidGetPrintedPagesCount(int cookie, int number_pages) {
DCHECK_GT(cookie, 0);
if (!OpportunisticallyCreatePrintJob(cookie))
@@ -117,21 +132,6 @@ void PrintViewManager::DidPrintPage(
ShouldQuitFromInnerMessageLoop();
}
-std::wstring PrintViewManager::RenderSourceName() {
- std::wstring name(UTF16ToWideHack(owner_.GetTitle()));
- if (name.empty())
- name = l10n_util::GetString(IDS_DEFAULT_PRINT_DOCUMENT_TITLE);
- return name;
-}
-
-GURL PrintViewManager::RenderSourceUrl() {
- NavigationEntry* entry = owner_.controller().GetActiveEntry();
- if (entry)
- return entry->display_url();
- else
- return GURL();
-}
-
void PrintViewManager::Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details) {
diff --git a/chrome/browser/printing/print_view_manager.h b/chrome/browser/printing/print_view_manager.h
index 2945b0c..ee87fa2 100644
--- a/chrome/browser/printing/print_view_manager.h
+++ b/chrome/browser/printing/print_view_manager.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_H_
#include "base/ref_counted.h"
+#include "chrome/browser/renderer_host/render_view_host_delegate.h"
#include "chrome/common/notification_registrar.h"
#include "printing/printed_pages_source.h"
@@ -22,7 +23,8 @@ class PrintJobWorkerOwner;
// Manages the print commands in relation to a TabContents. TabContents
// delegates a few printing related commands to this instance.
class PrintViewManager : public NotificationObserver,
- public PrintedPagesSource {
+ public PrintedPagesSource,
+ public RenderViewHostDelegate::Printing {
public:
PrintViewManager(TabContents& owner);
virtual ~PrintViewManager();
@@ -34,18 +36,14 @@ class PrintViewManager : public NotificationObserver,
// current state. Returns false if the renderer was not valuable.
bool OnRenderViewGone(RenderViewHost* render_view_host);
- // Received a notification from the renderer that the number of printed page
- // has just been calculated..
- void DidGetPrintedPagesCount(int cookie, int number_pages);
-
- // Received a notification from the renderer that a printed page page is
- // finished renderering.
- void DidPrintPage(const ViewHostMsg_DidPrintPage_Params& params);
-
// PrintedPagesSource implementation.
virtual std::wstring RenderSourceName();
virtual GURL RenderSourceUrl();
+ // RenderViewHostDelegate::Printing implementation.
+ virtual void DidGetPrintedPagesCount(int cookie, int number_pages);
+ virtual void DidPrintPage(const ViewHostMsg_DidPrintPage_Params& params);
+
// NotificationObserver implementation.
virtual void Observe(NotificationType type,
const NotificationSource& source,