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 "content/common/notification_registrar.h"
|
||||
#include "content/common/notification_service.h"
|
||||
#include "googleurl/src/gurl.h"
|
||||
#include "printing/printed_pages_source.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
@ -17,12 +16,9 @@ namespace {
|
||||
|
||||
class TestSource : public printing::PrintedPagesSource {
|
||||
public:
|
||||
virtual string16 RenderSourceName() {
|
||||
virtual string16 RenderSourceName() OVERRIDE {
|
||||
return string16();
|
||||
}
|
||||
virtual GURL RenderSourceUrl() {
|
||||
return GURL();
|
||||
}
|
||||
};
|
||||
|
||||
class TestPrintJobWorker : public printing::PrintJobWorker {
|
||||
@ -59,6 +55,7 @@ class TestOwner : public printing::PrintJobWorkerOwner {
|
||||
virtual int cookie() const {
|
||||
return 42;
|
||||
}
|
||||
|
||||
private:
|
||||
printing::PrintSettings settings_;
|
||||
};
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include "chrome/common/chrome_notification_types.h"
|
||||
#include "chrome/common/print_messages.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/common/notification_details.h"
|
||||
#include "content/common/notification_service.h"
|
||||
@ -159,13 +158,6 @@ string16 PrintViewManager::RenderSourceName() {
|
||||
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) {
|
||||
DCHECK_GT(cookie, 0);
|
||||
DCHECK_GT(number_pages, 0);
|
||||
|
@ -69,16 +69,15 @@ class PrintViewManager : public NotificationObserver,
|
||||
void ResetTitleOverride();
|
||||
|
||||
// PrintedPagesSource implementation.
|
||||
virtual string16 RenderSourceName();
|
||||
virtual GURL RenderSourceUrl();
|
||||
virtual string16 RenderSourceName() OVERRIDE;
|
||||
|
||||
// NotificationObserver implementation.
|
||||
virtual void Observe(int type,
|
||||
const NotificationSource& source,
|
||||
const NotificationDetails& details);
|
||||
const NotificationDetails& details) OVERRIDE;
|
||||
|
||||
// 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.
|
||||
virtual void RenderViewGone();
|
||||
@ -98,8 +97,8 @@ class PrintViewManager : public NotificationObserver,
|
||||
void OnNotifyPrintJobEvent(const JobEventDetails& event_details);
|
||||
|
||||
// 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
|
||||
// requested to the renderer.
|
||||
// No-op if no print job is pending. Returns true if at least one page has
|
||||
// been requested to the renderer.
|
||||
bool RenderAllMissingPagesNow();
|
||||
|
||||
// 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),
|
||||
source_message_loop_(MessageLoop::current()),
|
||||
name_(source->RenderSourceName()),
|
||||
url_(source->RenderSourceUrl()),
|
||||
cookie_(cookie) {
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "base/string16.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "googleurl/src/gurl.h"
|
||||
#include "printing/print_settings.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.
|
||||
const PrintSettings& settings() const { return immutable_.settings_; }
|
||||
const string16& name() const {
|
||||
return immutable_.name_;
|
||||
}
|
||||
const GURL& url() const { return immutable_.url_; }
|
||||
const string16& name() const { return immutable_.name_; }
|
||||
int cookie() const { return immutable_.cookie_; }
|
||||
|
||||
// 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.
|
||||
string16 name_;
|
||||
|
||||
// URL that generated this document. Immutable.
|
||||
GURL url_;
|
||||
|
||||
// Cookie to uniquely identify this document. It is used to make sure that a
|
||||
// PrintedPage is correctly belonging to the PrintedDocument. Since
|
||||
// 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
|
||||
// found in the LICENSE file.
|
||||
|
||||
@ -7,9 +7,6 @@
|
||||
|
||||
#include "base/string16.h"
|
||||
|
||||
class GURL;
|
||||
class MessageLoop;
|
||||
|
||||
namespace printing {
|
||||
|
||||
class PrintedDocument;
|
||||
@ -20,9 +17,6 @@ class PrintedPagesSource {
|
||||
// Returns the document title.
|
||||
virtual string16 RenderSourceName() = 0;
|
||||
|
||||
// Returns the URL's source of the document if applicable.
|
||||
virtual GURL RenderSourceUrl() = 0;
|
||||
|
||||
protected:
|
||||
virtual ~PrintedPagesSource() {}
|
||||
};
|
||||
|
Reference in New Issue
Block a user