Cleanup: Remove dead code - printing::PrintedPagesSource::RenderSourceName() and printing::PrintedDocument::url(). They were only used by the old headers/footers code.
BUG=none TEST=none Review URL: http://codereview.chromium.org/8113029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103970 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
chrome/browser/printing
printing
@@ -9,7 +9,6 @@
|
|||||||
#include "chrome/common/chrome_notification_types.h"
|
#include "chrome/common/chrome_notification_types.h"
|
||||||
#include "content/common/notification_registrar.h"
|
#include "content/common/notification_registrar.h"
|
||||||
#include "content/common/notification_service.h"
|
#include "content/common/notification_service.h"
|
||||||
#include "googleurl/src/gurl.h"
|
|
||||||
#include "printing/printed_pages_source.h"
|
#include "printing/printed_pages_source.h"
|
||||||
#include "testing/gtest/include/gtest/gtest.h"
|
#include "testing/gtest/include/gtest/gtest.h"
|
||||||
|
|
||||||
@@ -17,12 +16,9 @@ namespace {
|
|||||||
|
|
||||||
class TestSource : public printing::PrintedPagesSource {
|
class TestSource : public printing::PrintedPagesSource {
|
||||||
public:
|
public:
|
||||||
virtual string16 RenderSourceName() {
|
virtual string16 RenderSourceName() OVERRIDE {
|
||||||
return string16();
|
return string16();
|
||||||
}
|
}
|
||||||
virtual GURL RenderSourceUrl() {
|
|
||||||
return GURL();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class TestPrintJobWorker : public printing::PrintJobWorker {
|
class TestPrintJobWorker : public printing::PrintJobWorker {
|
||||||
@@ -59,6 +55,7 @@ class TestOwner : public printing::PrintJobWorkerOwner {
|
|||||||
virtual int cookie() const {
|
virtual int cookie() const {
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
printing::PrintSettings settings_;
|
printing::PrintSettings settings_;
|
||||||
};
|
};
|
||||||
|
@@ -17,7 +17,6 @@
|
|||||||
#include "chrome/common/chrome_notification_types.h"
|
#include "chrome/common/chrome_notification_types.h"
|
||||||
#include "chrome/common/print_messages.h"
|
#include "chrome/common/print_messages.h"
|
||||||
#include "content/browser/renderer_host/render_view_host.h"
|
#include "content/browser/renderer_host/render_view_host.h"
|
||||||
#include "content/browser/tab_contents/navigation_entry.h"
|
|
||||||
#include "content/browser/tab_contents/tab_contents.h"
|
#include "content/browser/tab_contents/tab_contents.h"
|
||||||
#include "content/common/notification_details.h"
|
#include "content/common/notification_details.h"
|
||||||
#include "content/common/notification_service.h"
|
#include "content/common/notification_service.h"
|
||||||
@@ -159,13 +158,6 @@ string16 PrintViewManager::RenderSourceName() {
|
|||||||
return GenerateRenderSourceName(tab_contents());
|
return GenerateRenderSourceName(tab_contents());
|
||||||
}
|
}
|
||||||
|
|
||||||
GURL PrintViewManager::RenderSourceUrl() {
|
|
||||||
NavigationEntry* entry = tab_contents()->controller().GetActiveEntry();
|
|
||||||
if (entry)
|
|
||||||
return entry->virtual_url();
|
|
||||||
return GURL();
|
|
||||||
}
|
|
||||||
|
|
||||||
void PrintViewManager::OnDidGetPrintedPagesCount(int cookie, int number_pages) {
|
void PrintViewManager::OnDidGetPrintedPagesCount(int cookie, int number_pages) {
|
||||||
DCHECK_GT(cookie, 0);
|
DCHECK_GT(cookie, 0);
|
||||||
DCHECK_GT(number_pages, 0);
|
DCHECK_GT(number_pages, 0);
|
||||||
|
@@ -69,16 +69,15 @@ class PrintViewManager : public NotificationObserver,
|
|||||||
void ResetTitleOverride();
|
void ResetTitleOverride();
|
||||||
|
|
||||||
// PrintedPagesSource implementation.
|
// PrintedPagesSource implementation.
|
||||||
virtual string16 RenderSourceName();
|
virtual string16 RenderSourceName() OVERRIDE;
|
||||||
virtual GURL RenderSourceUrl();
|
|
||||||
|
|
||||||
// NotificationObserver implementation.
|
// NotificationObserver implementation.
|
||||||
virtual void Observe(int type,
|
virtual void Observe(int type,
|
||||||
const NotificationSource& source,
|
const NotificationSource& source,
|
||||||
const NotificationDetails& details);
|
const NotificationDetails& details) OVERRIDE;
|
||||||
|
|
||||||
// TabContentsObserver implementation.
|
// TabContentsObserver implementation.
|
||||||
virtual bool OnMessageReceived(const IPC::Message& message);
|
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
|
||||||
|
|
||||||
// Terminates or cancels the print job if one was pending.
|
// Terminates or cancels the print job if one was pending.
|
||||||
virtual void RenderViewGone();
|
virtual void RenderViewGone();
|
||||||
@@ -98,8 +97,8 @@ class PrintViewManager : public NotificationObserver,
|
|||||||
void OnNotifyPrintJobEvent(const JobEventDetails& event_details);
|
void OnNotifyPrintJobEvent(const JobEventDetails& event_details);
|
||||||
|
|
||||||
// Requests the RenderView to render all the missing pages for the print job.
|
// Requests the RenderView to render all the missing pages for the print job.
|
||||||
// No-op if no print job is pending. Returns true if at least one page has been
|
// No-op if no print job is pending. Returns true if at least one page has
|
||||||
// requested to the renderer.
|
// been requested to the renderer.
|
||||||
bool RenderAllMissingPagesNow();
|
bool RenderAllMissingPagesNow();
|
||||||
|
|
||||||
// Quits the current message loop if these conditions hold true: a document is
|
// Quits the current message loop if these conditions hold true: a document is
|
||||||
|
@@ -224,7 +224,6 @@ PrintedDocument::Immutable::Immutable(const PrintSettings& settings,
|
|||||||
: settings_(settings),
|
: settings_(settings),
|
||||||
source_message_loop_(MessageLoop::current()),
|
source_message_loop_(MessageLoop::current()),
|
||||||
name_(source->RenderSourceName()),
|
name_(source->RenderSourceName()),
|
||||||
url_(source->RenderSourceUrl()),
|
|
||||||
cookie_(cookie) {
|
cookie_(cookie) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -11,7 +11,6 @@
|
|||||||
#include "base/memory/scoped_ptr.h"
|
#include "base/memory/scoped_ptr.h"
|
||||||
#include "base/string16.h"
|
#include "base/string16.h"
|
||||||
#include "base/synchronization/lock.h"
|
#include "base/synchronization/lock.h"
|
||||||
#include "googleurl/src/gurl.h"
|
|
||||||
#include "printing/print_settings.h"
|
#include "printing/print_settings.h"
|
||||||
#include "ui/gfx/native_widget_types.h"
|
#include "ui/gfx/native_widget_types.h"
|
||||||
|
|
||||||
@@ -94,10 +93,7 @@ class PRINTING_EXPORT PrintedDocument
|
|||||||
|
|
||||||
// Getters. All these items are immutable hence thread-safe.
|
// Getters. All these items are immutable hence thread-safe.
|
||||||
const PrintSettings& settings() const { return immutable_.settings_; }
|
const PrintSettings& settings() const { return immutable_.settings_; }
|
||||||
const string16& name() const {
|
const string16& name() const { return immutable_.name_; }
|
||||||
return immutable_.name_;
|
|
||||||
}
|
|
||||||
const GURL& url() const { return immutable_.url_; }
|
|
||||||
int cookie() const { return immutable_.cookie_; }
|
int cookie() const { return immutable_.cookie_; }
|
||||||
|
|
||||||
// Sets a path where to dump printing output files for debugging. If never set
|
// Sets a path where to dump printing output files for debugging. If never set
|
||||||
@@ -161,9 +157,6 @@ class PRINTING_EXPORT PrintedDocument
|
|||||||
// Document name. Immutable.
|
// Document name. Immutable.
|
||||||
string16 name_;
|
string16 name_;
|
||||||
|
|
||||||
// URL that generated this document. Immutable.
|
|
||||||
GURL url_;
|
|
||||||
|
|
||||||
// Cookie to uniquely identify this document. It is used to make sure that a
|
// Cookie to uniquely identify this document. It is used to make sure that a
|
||||||
// PrintedPage is correctly belonging to the PrintedDocument. Since
|
// PrintedPage is correctly belonging to the PrintedDocument. Since
|
||||||
// PrintedPage generation is completely asynchronous, it could be easy to
|
// PrintedPage generation is completely asynchronous, it could be easy to
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
@@ -7,9 +7,6 @@
|
|||||||
|
|
||||||
#include "base/string16.h"
|
#include "base/string16.h"
|
||||||
|
|
||||||
class GURL;
|
|
||||||
class MessageLoop;
|
|
||||||
|
|
||||||
namespace printing {
|
namespace printing {
|
||||||
|
|
||||||
class PrintedDocument;
|
class PrintedDocument;
|
||||||
@@ -20,9 +17,6 @@ class PrintedPagesSource {
|
|||||||
// Returns the document title.
|
// Returns the document title.
|
||||||
virtual string16 RenderSourceName() = 0;
|
virtual string16 RenderSourceName() = 0;
|
||||||
|
|
||||||
// Returns the URL's source of the document if applicable.
|
|
||||||
virtual GURL RenderSourceUrl() = 0;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~PrintedPagesSource() {}
|
virtual ~PrintedPagesSource() {}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user