Commit 176ca8f5 authored by Vitaly Buka's avatar Vitaly Buka

Removed IDC_PRINT_TO_DESTINATION.

This code was used for Win8 non-aura builds. Now it's dead.
metro_driver should be cleared separately as it has a lot of stuff excluded from build.

BUG=142330
NOTRY=true
R=mad@chromium.org, thestig@chromium.org

Review URL: https://codereview.chromium.org/524543002

Cr-Commit-Position: refs/heads/master@{#292683}
parent 5f02caf4
...@@ -85,7 +85,6 @@ ...@@ -85,7 +85,6 @@
#define IDC_ENCODING_MENU 35005 #define IDC_ENCODING_MENU 35005
#define IDC_EMAIL_PAGE_LOCATION 35006 #define IDC_EMAIL_PAGE_LOCATION 35006
#define IDC_ADVANCED_PRINT 35007 #define IDC_ADVANCED_PRINT 35007
#define IDC_PRINT_TO_DESTINATION 35008
#define IDC_TRANSLATE_PAGE 35009 #define IDC_TRANSLATE_PAGE 35009
#define IDC_MANAGE_PASSWORDS_FOR_PAGE 35010 #define IDC_MANAGE_PASSWORDS_FOR_PAGE 35010
......
...@@ -22,11 +22,6 @@ PrintQueriesQueue::~PrintQueriesQueue() { ...@@ -22,11 +22,6 @@ PrintQueriesQueue::~PrintQueriesQueue() {
queued_queries_.clear(); queued_queries_.clear();
} }
void PrintQueriesQueue::SetDestination(PrintDestinationInterface* destination) {
base::AutoLock lock(lock_);
destination_ = destination;
}
void PrintQueriesQueue::QueuePrinterQuery(PrinterQuery* job) { void PrintQueriesQueue::QueuePrinterQuery(PrinterQuery* job) {
base::AutoLock lock(lock_); base::AutoLock lock(lock_);
DCHECK(job); DCHECK(job);
...@@ -54,8 +49,6 @@ scoped_refptr<PrinterQuery> PrintQueriesQueue::CreatePrinterQuery( ...@@ -54,8 +49,6 @@ scoped_refptr<PrinterQuery> PrintQueriesQueue::CreatePrinterQuery(
int render_view_id) { int render_view_id) {
scoped_refptr<PrinterQuery> job = scoped_refptr<PrinterQuery> job =
new printing::PrinterQuery(render_process_id, render_view_id); new printing::PrinterQuery(render_process_id, render_view_id);
base::AutoLock lock(lock_);
job->SetWorkerDestination(destination_.get());
return job; return job;
} }
...@@ -64,7 +57,6 @@ void PrintQueriesQueue::Shutdown() { ...@@ -64,7 +57,6 @@ void PrintQueriesQueue::Shutdown() {
{ {
base::AutoLock lock(lock_); base::AutoLock lock(lock_);
queued_queries_.swap(queries_to_stop); queued_queries_.swap(queries_to_stop);
destination_ = NULL;
} }
// Stop all pending queries, requests to generate print preview do not have // Stop all pending queries, requests to generate print preview do not have
// corresponding PrintJob, so any pending preview requests are not covered // corresponding PrintJob, so any pending preview requests are not covered
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "base/threading/non_thread_safe.h" #include "base/threading/non_thread_safe.h"
#include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h" #include "content/public/browser/notification_registrar.h"
#include "printing/print_destination_interface.h"
namespace printing { namespace printing {
...@@ -27,9 +26,6 @@ class PrintQueriesQueue : public base::RefCountedThreadSafe<PrintQueriesQueue> { ...@@ -27,9 +26,6 @@ class PrintQueriesQueue : public base::RefCountedThreadSafe<PrintQueriesQueue> {
public: public:
PrintQueriesQueue(); PrintQueriesQueue();
// Sets the print destination to be set on the next print job.
void SetDestination(PrintDestinationInterface* destination);
// Queues a semi-initialized worker thread. Can be called from any thread. // Queues a semi-initialized worker thread. Can be called from any thread.
// Current use case is queuing from the I/O thread. // Current use case is queuing from the I/O thread.
// TODO(maruel): Have them vanish after a timeout (~5 minutes?) // TODO(maruel): Have them vanish after a timeout (~5 minutes?)
...@@ -56,8 +52,6 @@ class PrintQueriesQueue : public base::RefCountedThreadSafe<PrintQueriesQueue> { ...@@ -56,8 +52,6 @@ class PrintQueriesQueue : public base::RefCountedThreadSafe<PrintQueriesQueue> {
PrinterQueries queued_queries_; PrinterQueries queued_queries_;
scoped_refptr<PrintDestinationInterface> destination_;
DISALLOW_COPY_AND_ASSIGN(PrintQueriesQueue); DISALLOW_COPY_AND_ASSIGN(PrintQueriesQueue);
}; };
......
...@@ -111,11 +111,6 @@ void PrintJobWorker::SetNewOwner(PrintJobWorkerOwner* new_owner) { ...@@ -111,11 +111,6 @@ void PrintJobWorker::SetNewOwner(PrintJobWorkerOwner* new_owner) {
owner_ = new_owner; owner_ = new_owner;
} }
void PrintJobWorker::SetPrintDestination(
PrintDestinationInterface* destination) {
destination_ = destination;
}
void PrintJobWorker::GetSettings( void PrintJobWorker::GetSettings(
bool ask_user_for_settings, bool ask_user_for_settings,
int document_page_count, int document_page_count,
...@@ -134,7 +129,7 @@ void PrintJobWorker::GetSettings( ...@@ -134,7 +129,7 @@ void PrintJobWorker::GetSettings(
// When we delegate to a destination, we don't ask the user for settings. // When we delegate to a destination, we don't ask the user for settings.
// TODO(mad): Ask the destination for settings. // TODO(mad): Ask the destination for settings.
if (ask_user_for_settings && destination_.get() == NULL) { if (ask_user_for_settings) {
BrowserThread::PostTask( BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE, BrowserThread::UI, FROM_HERE,
base::Bind(&HoldRefCallback, make_scoped_refptr(owner_), base::Bind(&HoldRefCallback, make_scoped_refptr(owner_),
...@@ -277,8 +272,6 @@ void PrintJobWorker::OnNewPage() { ...@@ -277,8 +272,6 @@ void PrintJobWorker::OnNewPage() {
} }
// We have enough information to initialize page_number_. // We have enough information to initialize page_number_.
page_number_.Init(document_->settings(), page_count); page_number_.Init(document_->settings(), page_count);
if (destination_.get() != NULL)
destination_->SetPageCount(page_count);
} }
DCHECK_NE(page_number_, PageNumber::npos()); DCHECK_NE(page_number_, PageNumber::npos());
...@@ -375,18 +368,6 @@ void PrintJobWorker::SpoolPage(PrintedPage* page) { ...@@ -375,18 +368,6 @@ void PrintJobWorker::SpoolPage(PrintedPage* page) {
return; return;
} }
if (destination_.get() != NULL) {
std::vector<uint8> metabytes(page->metafile()->GetDataSize());
bool success = page->metafile()->GetData(
reinterpret_cast<void*>(&metabytes[0]), metabytes.size());
DCHECK(success) << "Failed to get metafile data.";
destination_->SetPageContent(
page->page_number(),
reinterpret_cast<void*>(&metabytes[0]),
metabytes.size());
return;
}
// Actual printing. // Actual printing.
#if defined(OS_WIN) || defined(OS_MACOSX) #if defined(OS_WIN) || defined(OS_MACOSX)
document_->RenderPrintedPage(*page, printing_context_->context()); document_->RenderPrintedPage(*page, printing_context_->context());
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "base/threading/thread.h" #include "base/threading/thread.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "printing/page_number.h" #include "printing/page_number.h"
#include "printing/print_destination_interface.h"
#include "printing/print_job_constants.h" #include "printing/print_job_constants.h"
#include "printing/printing_context.h" #include "printing/printing_context.h"
...@@ -40,10 +39,6 @@ class PrintJobWorker { ...@@ -40,10 +39,6 @@ class PrintJobWorker {
void SetNewOwner(PrintJobWorkerOwner* new_owner); void SetNewOwner(PrintJobWorkerOwner* new_owner);
// Set a destination for print.
// This supersedes the document's rendering destination.
void SetPrintDestination(PrintDestinationInterface* destination);
// Initializes the print settings. If |ask_user_for_settings| is true, a // Initializes the print settings. If |ask_user_for_settings| is true, a
// Print... dialog box will be shown to ask the user his preference. // Print... dialog box will be shown to ask the user his preference.
void GetSettings( void GetSettings(
...@@ -140,9 +135,6 @@ class PrintJobWorker { ...@@ -140,9 +135,6 @@ class PrintJobWorker {
// The printed document. Only has read-only access. // The printed document. Only has read-only access.
scoped_refptr<PrintedDocument> document_; scoped_refptr<PrintedDocument> document_;
// The print destination, may be NULL.
scoped_refptr<PrintDestinationInterface> destination_;
// The print job owning this worker thread. It is guaranteed to outlive this // The print job owning this worker thread. It is guaranteed to outlive this
// object. // object.
PrintJobWorkerOwner* owner_; PrintJobWorkerOwner* owner_;
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include "chrome/common/print_messages.h" #include "chrome/common/print_messages.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "printing/print_destination_interface.h"
using content::BrowserThread; using content::BrowserThread;
...@@ -73,16 +72,6 @@ bool PrintViewManager::AdvancedPrintNow() { ...@@ -73,16 +72,6 @@ bool PrintViewManager::AdvancedPrintNow() {
} }
} }
bool PrintViewManager::PrintToDestination() {
// TODO(mad): Remove this once we can send user metrics from the metro driver.
// crbug.com/142330
UMA_HISTOGRAM_ENUMERATION("Metro.Print", 0, 2);
// TODO(mad): Use a passed in destination interface instead.
g_browser_process->print_job_manager()->queue()->SetDestination(
printing::CreatePrintDestination());
return PrintNowInternal(new PrintMsg_PrintPages(routing_id()));
}
bool PrintViewManager::PrintPreviewNow(bool selection_only) { bool PrintViewManager::PrintPreviewNow(bool selection_only) {
// Users can send print commands all they want and it is beyond // Users can send print commands all they want and it is beyond
// PrintViewManager's control. Just ignore the extra commands. // PrintViewManager's control. Just ignore the extra commands.
......
...@@ -31,11 +31,6 @@ class PrintViewManager : public PrintViewManagerBase, ...@@ -31,11 +31,6 @@ class PrintViewManager : public PrintViewManagerBase,
// preview dialog. // preview dialog.
bool AdvancedPrintNow(); bool AdvancedPrintNow();
// Same as PrintNow(), but for the case where we want to send the result to
// another destination.
// TODO(mad) Add an argument so we can pass the destination interface.
bool PrintToDestination();
// Initiate print preview of the current document by first notifying the // Initiate print preview of the current document by first notifying the
// renderer. Since this happens asynchronous, the print preview dialog // renderer. Since this happens asynchronous, the print preview dialog
// creation will not be completed on the return of this function. Returns // creation will not be completed on the return of this function. Returns
......
...@@ -551,8 +551,6 @@ void PrintViewManagerBase::ReleasePrinterQuery() { ...@@ -551,8 +551,6 @@ void PrintViewManagerBase::ReleasePrinterQuery() {
int cookie = cookie_; int cookie = cookie_;
cookie_ = 0; cookie_ = 0;
queue_->SetDestination(NULL);
printing::PrintJobManager* print_job_manager = printing::PrintJobManager* print_job_manager =
g_browser_process->print_job_manager(); g_browser_process->print_job_manager();
......
...@@ -95,11 +95,6 @@ void PrinterQuery::SetSettings(scoped_ptr<base::DictionaryValue> new_settings, ...@@ -95,11 +95,6 @@ void PrinterQuery::SetSettings(scoped_ptr<base::DictionaryValue> new_settings,
base::Passed(&new_settings))); base::Passed(&new_settings)));
} }
void PrinterQuery::SetWorkerDestination(
PrintDestinationInterface* destination) {
worker_->SetPrintDestination(destination);
}
void PrinterQuery::StartWorker(const base::Closure& callback) { void PrinterQuery::StartWorker(const base::Closure& callback) {
DCHECK(callback_.is_null()); DCHECK(callback_.is_null());
DCHECK(worker_.get()); DCHECK(worker_.get());
......
...@@ -53,9 +53,6 @@ class PrinterQuery : public PrintJobWorkerOwner { ...@@ -53,9 +53,6 @@ class PrinterQuery : public PrintJobWorkerOwner {
void SetSettings(scoped_ptr<base::DictionaryValue> new_settings, void SetSettings(scoped_ptr<base::DictionaryValue> new_settings,
const base::Closure& callback); const base::Closure& callback);
// Set a destination for the worker.
void SetWorkerDestination(PrintDestinationInterface* destination);
// Stops the worker thread since the client is done with this object. // Stops the worker thread since the client is done with this object.
void StopWorker(); void StopWorker();
......
...@@ -548,9 +548,6 @@ void BrowserCommandController::ExecuteCommandWithDisposition( ...@@ -548,9 +548,6 @@ void BrowserCommandController::ExecuteCommandWithDisposition(
AdvancedPrint(browser_); AdvancedPrint(browser_);
break; break;
#endif // !OS_WIN #endif // !OS_WIN
case IDC_PRINT_TO_DESTINATION:
PrintToDestination(browser_);
break;
case IDC_TRANSLATE_PAGE: case IDC_TRANSLATE_PAGE:
Translate(browser_); Translate(browser_);
break; break;
......
...@@ -888,15 +888,6 @@ bool CanAdvancedPrint(Browser* browser) { ...@@ -888,15 +888,6 @@ bool CanAdvancedPrint(Browser* browser) {
} }
#endif // !OS_WIN #endif // !OS_WIN
void PrintToDestination(Browser* browser) {
#if defined(ENABLE_FULL_PRINTING)
printing::PrintViewManager* print_view_manager =
printing::PrintViewManager::FromWebContents(
browser->tab_strip_model()->GetActiveWebContents());
print_view_manager->PrintToDestination();
#endif
}
void EmailPageLocation(Browser* browser) { void EmailPageLocation(Browser* browser) {
content::RecordAction(UserMetricsAction("EmailPageLocation")); content::RecordAction(UserMetricsAction("EmailPageLocation"));
WebContents* wc = browser->tab_strip_model()->GetActiveWebContents(); WebContents* wc = browser->tab_strip_model()->GetActiveWebContents();
......
...@@ -114,7 +114,6 @@ bool CanPrint(Browser* browser); ...@@ -114,7 +114,6 @@ bool CanPrint(Browser* browser);
void AdvancedPrint(Browser* browser); void AdvancedPrint(Browser* browser);
bool CanAdvancedPrint(Browser* browser); bool CanAdvancedPrint(Browser* browser);
#endif // !OS_WIN #endif // !OS_WIN
void PrintToDestination(Browser* browser);
void EmailPageLocation(Browser* browser); void EmailPageLocation(Browser* browser);
bool CanEmailPageLocation(const Browser* browser); bool CanEmailPageLocation(const Browser* browser);
void Cut(Browser* browser); void Cut(Browser* browser);
......
...@@ -42,8 +42,6 @@ component("printing") { ...@@ -42,8 +42,6 @@ component("printing") {
"pdf_metafile_cg_mac.h", "pdf_metafile_cg_mac.h",
"pdf_metafile_skia.cc", "pdf_metafile_skia.cc",
"pdf_metafile_skia.h", "pdf_metafile_skia.h",
"print_destination_interface.h",
"print_destination_none.cc",
"print_dialog_gtk_interface.h", "print_dialog_gtk_interface.h",
"print_job_constants.cc", "print_job_constants.cc",
"print_job_constants.h", "print_job_constants.h",
......
// Copyright (c) 2012 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.
#ifndef PRINTING_PRINT_DESTINATION_INTERFACE_H_
#define PRINTING_PRINT_DESTINATION_INTERFACE_H_
#include "base/memory/ref_counted.h"
#include "printing/printing_export.h"
namespace printing {
class PrintDestinationInterface
: public base::RefCountedThreadSafe<PrintDestinationInterface> {
public:
// Sets the number of pages to print as soon as it is known.
virtual void SetPageCount(int page_count) = 0;
// Sets the metafile bits for a given page as soon as it is ready.
virtual void SetPageContent(int page_number,
void* content,
size_t content_size) = 0;
protected:
friend class base::RefCountedThreadSafe<PrintDestinationInterface>;
virtual ~PrintDestinationInterface() {}
};
PRINTING_EXPORT PrintDestinationInterface* CreatePrintDestination();
} // namespace printing
#endif // PRINTING_PRINT_DESTINATION_INTERFACE_H_
// Copyright (c) 2012 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 "printing/print_destination_interface.h"
namespace printing {
PrintDestinationInterface* CreatePrintDestination() {
return NULL;
}
} // namespace printing
...@@ -57,8 +57,6 @@ ...@@ -57,8 +57,6 @@
'pdf_metafile_cg_mac.h', 'pdf_metafile_cg_mac.h',
'pdf_metafile_skia.cc', 'pdf_metafile_skia.cc',
'pdf_metafile_skia.h', 'pdf_metafile_skia.h',
'print_destination_interface.h',
'print_destination_none.cc',
'print_dialog_gtk_interface.h', 'print_dialog_gtk_interface.h',
'print_job_constants.cc', 'print_job_constants.cc',
'print_job_constants.h', 'print_job_constants.h',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment