summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@chromium.org>2014-08-29 14:27:52 -0700
committerVitaly Buka <vitalybuka@chromium.org>2014-08-29 21:32:06 +0000
commit176ca8f58e7c2d4a26cdf0fa64807b25482a4494 (patch)
tree62f8da2b83f39a8ea612c18ec28396a3c681f1ce
parent5f02caf4667ea96828f68d5b6ea6ed371e592a47 (diff)
downloadchromium_src-176ca8f58e7c2d4a26cdf0fa64807b25482a4494.zip
chromium_src-176ca8f58e7c2d4a26cdf0fa64807b25482a4494.tar.gz
chromium_src-176ca8f58e7c2d4a26cdf0fa64807b25482a4494.tar.bz2
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}
-rw-r--r--chrome/app/chrome_command_ids.h1
-rw-r--r--chrome/browser/printing/print_job_manager.cc8
-rw-r--r--chrome/browser/printing/print_job_manager.h6
-rw-r--r--chrome/browser/printing/print_job_worker.cc21
-rw-r--r--chrome/browser/printing/print_job_worker.h8
-rw-r--r--chrome/browser/printing/print_view_manager.cc11
-rw-r--r--chrome/browser/printing/print_view_manager.h5
-rw-r--r--chrome/browser/printing/print_view_manager_base.cc2
-rw-r--r--chrome/browser/printing/printer_query.cc5
-rw-r--r--chrome/browser/printing/printer_query.h3
-rw-r--r--chrome/browser/ui/browser_command_controller.cc3
-rw-r--r--chrome/browser/ui/browser_commands.cc9
-rw-r--r--chrome/browser/ui/browser_commands.h1
-rw-r--r--printing/BUILD.gn2
-rw-r--r--printing/print_destination_interface.h32
-rw-r--r--printing/print_destination_none.cc13
-rw-r--r--printing/printing.gyp2
17 files changed, 1 insertions, 131 deletions
diff --git a/chrome/app/chrome_command_ids.h b/chrome/app/chrome_command_ids.h
index c680752..7a22ed7 100644
--- a/chrome/app/chrome_command_ids.h
+++ b/chrome/app/chrome_command_ids.h
@@ -85,7 +85,6 @@
#define IDC_ENCODING_MENU 35005
#define IDC_EMAIL_PAGE_LOCATION 35006
#define IDC_ADVANCED_PRINT 35007
-#define IDC_PRINT_TO_DESTINATION 35008
#define IDC_TRANSLATE_PAGE 35009
#define IDC_MANAGE_PASSWORDS_FOR_PAGE 35010
diff --git a/chrome/browser/printing/print_job_manager.cc b/chrome/browser/printing/print_job_manager.cc
index b600d1a..ec08a98 100644
--- a/chrome/browser/printing/print_job_manager.cc
+++ b/chrome/browser/printing/print_job_manager.cc
@@ -22,11 +22,6 @@ PrintQueriesQueue::~PrintQueriesQueue() {
queued_queries_.clear();
}
-void PrintQueriesQueue::SetDestination(PrintDestinationInterface* destination) {
- base::AutoLock lock(lock_);
- destination_ = destination;
-}
-
void PrintQueriesQueue::QueuePrinterQuery(PrinterQuery* job) {
base::AutoLock lock(lock_);
DCHECK(job);
@@ -54,8 +49,6 @@ scoped_refptr<PrinterQuery> PrintQueriesQueue::CreatePrinterQuery(
int render_view_id) {
scoped_refptr<PrinterQuery> job =
new printing::PrinterQuery(render_process_id, render_view_id);
- base::AutoLock lock(lock_);
- job->SetWorkerDestination(destination_.get());
return job;
}
@@ -64,7 +57,6 @@ void PrintQueriesQueue::Shutdown() {
{
base::AutoLock lock(lock_);
queued_queries_.swap(queries_to_stop);
- destination_ = NULL;
}
// Stop all pending queries, requests to generate print preview do not have
// corresponding PrintJob, so any pending preview requests are not covered
diff --git a/chrome/browser/printing/print_job_manager.h b/chrome/browser/printing/print_job_manager.h
index 5efd966..ef61541 100644
--- a/chrome/browser/printing/print_job_manager.h
+++ b/chrome/browser/printing/print_job_manager.h
@@ -15,7 +15,6 @@
#include "base/threading/non_thread_safe.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
-#include "printing/print_destination_interface.h"
namespace printing {
@@ -27,9 +26,6 @@ class PrintQueriesQueue : public base::RefCountedThreadSafe<PrintQueriesQueue> {
public:
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.
// Current use case is queuing from the I/O thread.
// TODO(maruel): Have them vanish after a timeout (~5 minutes?)
@@ -56,8 +52,6 @@ class PrintQueriesQueue : public base::RefCountedThreadSafe<PrintQueriesQueue> {
PrinterQueries queued_queries_;
- scoped_refptr<PrintDestinationInterface> destination_;
-
DISALLOW_COPY_AND_ASSIGN(PrintQueriesQueue);
};
diff --git a/chrome/browser/printing/print_job_worker.cc b/chrome/browser/printing/print_job_worker.cc
index 1247351..5e3c59c 100644
--- a/chrome/browser/printing/print_job_worker.cc
+++ b/chrome/browser/printing/print_job_worker.cc
@@ -111,11 +111,6 @@ void PrintJobWorker::SetNewOwner(PrintJobWorkerOwner* new_owner) {
owner_ = new_owner;
}
-void PrintJobWorker::SetPrintDestination(
- PrintDestinationInterface* destination) {
- destination_ = destination;
-}
-
void PrintJobWorker::GetSettings(
bool ask_user_for_settings,
int document_page_count,
@@ -134,7 +129,7 @@ void PrintJobWorker::GetSettings(
// When we delegate to a destination, we don't ask the user 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::UI, FROM_HERE,
base::Bind(&HoldRefCallback, make_scoped_refptr(owner_),
@@ -277,8 +272,6 @@ void PrintJobWorker::OnNewPage() {
}
// We have enough information to initialize page_number_.
page_number_.Init(document_->settings(), page_count);
- if (destination_.get() != NULL)
- destination_->SetPageCount(page_count);
}
DCHECK_NE(page_number_, PageNumber::npos());
@@ -375,18 +368,6 @@ void PrintJobWorker::SpoolPage(PrintedPage* page) {
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.
#if defined(OS_WIN) || defined(OS_MACOSX)
document_->RenderPrintedPage(*page, printing_context_->context());
diff --git a/chrome/browser/printing/print_job_worker.h b/chrome/browser/printing/print_job_worker.h
index 02aac9a..a8378bb 100644
--- a/chrome/browser/printing/print_job_worker.h
+++ b/chrome/browser/printing/print_job_worker.h
@@ -11,7 +11,6 @@
#include "base/threading/thread.h"
#include "content/public/browser/browser_thread.h"
#include "printing/page_number.h"
-#include "printing/print_destination_interface.h"
#include "printing/print_job_constants.h"
#include "printing/printing_context.h"
@@ -40,10 +39,6 @@ class PrintJobWorker {
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
// Print... dialog box will be shown to ask the user his preference.
void GetSettings(
@@ -140,9 +135,6 @@ class PrintJobWorker {
// The printed document. Only has read-only access.
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
// object.
PrintJobWorkerOwner* owner_;
diff --git a/chrome/browser/printing/print_view_manager.cc b/chrome/browser/printing/print_view_manager.cc
index 43a760c..e0f4ef9 100644
--- a/chrome/browser/printing/print_view_manager.cc
+++ b/chrome/browser/printing/print_view_manager.cc
@@ -17,7 +17,6 @@
#include "chrome/common/print_messages.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_contents.h"
-#include "printing/print_destination_interface.h"
using content::BrowserThread;
@@ -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) {
// Users can send print commands all they want and it is beyond
// PrintViewManager's control. Just ignore the extra commands.
diff --git a/chrome/browser/printing/print_view_manager.h b/chrome/browser/printing/print_view_manager.h
index 333fb6a..5406725 100644
--- a/chrome/browser/printing/print_view_manager.h
+++ b/chrome/browser/printing/print_view_manager.h
@@ -31,11 +31,6 @@ class PrintViewManager : public PrintViewManagerBase,
// preview dialog.
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
// renderer. Since this happens asynchronous, the print preview dialog
// creation will not be completed on the return of this function. Returns
diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc
index 3880a27..16beeed 100644
--- a/chrome/browser/printing/print_view_manager_base.cc
+++ b/chrome/browser/printing/print_view_manager_base.cc
@@ -551,8 +551,6 @@ void PrintViewManagerBase::ReleasePrinterQuery() {
int cookie = cookie_;
cookie_ = 0;
- queue_->SetDestination(NULL);
-
printing::PrintJobManager* print_job_manager =
g_browser_process->print_job_manager();
diff --git a/chrome/browser/printing/printer_query.cc b/chrome/browser/printing/printer_query.cc
index 68b9fe7..6cd11ff 100644
--- a/chrome/browser/printing/printer_query.cc
+++ b/chrome/browser/printing/printer_query.cc
@@ -95,11 +95,6 @@ void PrinterQuery::SetSettings(scoped_ptr<base::DictionaryValue> new_settings,
base::Passed(&new_settings)));
}
-void PrinterQuery::SetWorkerDestination(
- PrintDestinationInterface* destination) {
- worker_->SetPrintDestination(destination);
-}
-
void PrinterQuery::StartWorker(const base::Closure& callback) {
DCHECK(callback_.is_null());
DCHECK(worker_.get());
diff --git a/chrome/browser/printing/printer_query.h b/chrome/browser/printing/printer_query.h
index 84cf24a..22af08d 100644
--- a/chrome/browser/printing/printer_query.h
+++ b/chrome/browser/printing/printer_query.h
@@ -53,9 +53,6 @@ class PrinterQuery : public PrintJobWorkerOwner {
void SetSettings(scoped_ptr<base::DictionaryValue> new_settings,
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.
void StopWorker();
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc
index 1c56704..daf8e1d 100644
--- a/chrome/browser/ui/browser_command_controller.cc
+++ b/chrome/browser/ui/browser_command_controller.cc
@@ -548,9 +548,6 @@ void BrowserCommandController::ExecuteCommandWithDisposition(
AdvancedPrint(browser_);
break;
#endif // !OS_WIN
- case IDC_PRINT_TO_DESTINATION:
- PrintToDestination(browser_);
- break;
case IDC_TRANSLATE_PAGE:
Translate(browser_);
break;
diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc
index 9ff7443..135859e 100644
--- a/chrome/browser/ui/browser_commands.cc
+++ b/chrome/browser/ui/browser_commands.cc
@@ -888,15 +888,6 @@ bool CanAdvancedPrint(Browser* browser) {
}
#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) {
content::RecordAction(UserMetricsAction("EmailPageLocation"));
WebContents* wc = browser->tab_strip_model()->GetActiveWebContents();
diff --git a/chrome/browser/ui/browser_commands.h b/chrome/browser/ui/browser_commands.h
index bfa747b..a2daa77 100644
--- a/chrome/browser/ui/browser_commands.h
+++ b/chrome/browser/ui/browser_commands.h
@@ -114,7 +114,6 @@ bool CanPrint(Browser* browser);
void AdvancedPrint(Browser* browser);
bool CanAdvancedPrint(Browser* browser);
#endif // !OS_WIN
-void PrintToDestination(Browser* browser);
void EmailPageLocation(Browser* browser);
bool CanEmailPageLocation(const Browser* browser);
void Cut(Browser* browser);
diff --git a/printing/BUILD.gn b/printing/BUILD.gn
index 6e6678d..2a0d2b5 100644
--- a/printing/BUILD.gn
+++ b/printing/BUILD.gn
@@ -42,8 +42,6 @@ component("printing") {
"pdf_metafile_cg_mac.h",
"pdf_metafile_skia.cc",
"pdf_metafile_skia.h",
- "print_destination_interface.h",
- "print_destination_none.cc",
"print_dialog_gtk_interface.h",
"print_job_constants.cc",
"print_job_constants.h",
diff --git a/printing/print_destination_interface.h b/printing/print_destination_interface.h
deleted file mode 100644
index 715f529..0000000
--- a/printing/print_destination_interface.h
+++ /dev/null
@@ -1,32 +0,0 @@
-// 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_
diff --git a/printing/print_destination_none.cc b/printing/print_destination_none.cc
deleted file mode 100644
index 66b838e..0000000
--- a/printing/print_destination_none.cc
+++ /dev/null
@@ -1,13 +0,0 @@
-// 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
diff --git a/printing/printing.gyp b/printing/printing.gyp
index 81ffe34..fe2aeda 100644
--- a/printing/printing.gyp
+++ b/printing/printing.gyp
@@ -57,8 +57,6 @@
'pdf_metafile_cg_mac.h',
'pdf_metafile_skia.cc',
'pdf_metafile_skia.h',
- 'print_destination_interface.h',
- 'print_destination_none.cc',
'print_dialog_gtk_interface.h',
'print_job_constants.cc',
'print_job_constants.h',