Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2847)

Unified Diff: chrome/browser/ui/webui/print_preview/print_preview_handler.cc

Issue 73503002: Move PDF to PWG conversion into PrivetLocalPrintOperationImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/print_preview/print_preview_handler.cc
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
index 8dcfd8cdbbb40f5cdd79fcb791baf6bd355b168d..b532d4592024d16892f32fe255e499647eb01425 100644
--- a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
+++ b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
@@ -1422,10 +1422,19 @@ void PrintPreviewHandler::StartPrivetLocalPrint(
privet_local_print_operation_->SetTicket(print_ticket);
- PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>(
- web_ui()->GetController());
+ scoped_refptr<base::RefCountedBytes> data;
+ string16 title;
+
+ if (!GetPreviewDataAndTitle(&data, &title)) {
+ base::FundamentalValue http_code_value(-1);
+ web_ui()->CallJavascriptFunction("onPrivetPrintFailed", http_code_value);
+ return;
+ }
+
privet_local_print_operation_->SetJobname(
- base::UTF16ToUTF8(print_preview_ui->initiator_title()));
+ base::UTF16ToUTF8(title));
+
+ privet_local_print_operation_->SetData(data);
Profile* profile = Profile::FromWebUI(web_ui());
SigninManagerBase* signin_manager =
@@ -1513,28 +1522,6 @@ bool PrintPreviewHandler::CreatePrivetHTTP(
return true;
}
-void PrintPreviewHandler::OnPrivetPrintingRequestPDF(
- const local_discovery::PrivetLocalPrintOperation* print_operation) {
- scoped_refptr<base::RefCountedBytes> data;
- string16 title;
-
- if (!GetPreviewDataAndTitle(&data, &title)) {
- base::FundamentalValue http_code_value(-1);
- web_ui()->CallJavascriptFunction("onPrivetPrintFailed", http_code_value);
- return;
- }
-
- // TODO(noamsml): Move data into request without copying it?
- std::string data_str((const char*)data->front(), data->size());
-
- privet_local_print_operation_->SendData(data_str);
-}
-
-void PrintPreviewHandler::OnPrivetPrintingRequestPWGRaster(
- const local_discovery::PrivetLocalPrintOperation* print_operation) {
- NOTIMPLEMENTED();
-}
-
void PrintPreviewHandler::OnPrivetPrintingDone(
const local_discovery::PrivetLocalPrintOperation* print_operation) {
ClosePreviewDialog();

Powered by Google App Engine
This is Rietveld 408576698