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

Unified Diff: chrome/browser/printing/print_job_worker.cc

Issue 10941025: Simplify document title for Windows printing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months 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
« no previous file with comments | « no previous file | chrome/service/cloud_print/print_system_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/print_job_worker.cc
diff --git a/chrome/browser/printing/print_job_worker.cc b/chrome/browser/printing/print_job_worker.cc
index 90ea9616adc64423daad18b6437227a687a90ab0..42ebab8dc20c86ac7189846759944a57ff58d7cc 100644
--- a/chrome/browser/printing/print_job_worker.cc
+++ b/chrome/browser/printing/print_job_worker.cc
@@ -15,9 +15,12 @@
#include "chrome/common/chrome_notification_types.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
+#include "grit/generated_resources.h"
+#include "printing/backend/print_backend.h"
#include "printing/print_job_constants.h"
#include "printing/printed_document.h"
#include "printing/printed_page.h"
+#include "ui/base/l10n/l10n_util.h"
using content::BrowserThread;
@@ -202,8 +205,14 @@ void PrintJobWorker::StartPrinting(PrintedDocument* new_document) {
return;
}
+ string16 document_name =
+ printing::PrintBackend::SimplifyDocumentTitle(document_->name());
+ if (document_name.empty()) {
+ document_name = printing::PrintBackend::SimplifyDocumentTitle(
+ l10n_util::GetStringUTF16(IDS_DEFAULT_PRINT_DOCUMENT_TITLE));
+ }
PrintingContext::Result result =
- printing_context_->NewDocument(document_->name());
+ printing_context_->NewDocument(document_name);
if (result != PrintingContext::OK) {
OnFailure();
return;
« no previous file with comments | « no previous file | chrome/service/cloud_print/print_system_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698