Index: chrome/browser/printing/print_view_manager.cc |
diff --git a/chrome/browser/printing/print_view_manager.cc b/chrome/browser/printing/print_view_manager.cc |
index 20ac4eaacf617c126dd04a8aaa91ee743e6e9578..839273d20abb9514e0110a1506455348862edde3 100644 |
--- a/chrome/browser/printing/print_view_manager.cc |
+++ b/chrome/browser/printing/print_view_manager.cc |
@@ -60,10 +60,14 @@ void PrintViewManager::RenderViewGone() { |
} |
string16 PrintViewManager::RenderSourceName() { |
- string16 name(tab_contents()->GetTitle()); |
- if (name.empty()) |
- name = l10n_util::GetStringUTF16(IDS_DEFAULT_PRINT_DOCUMENT_TITLE); |
- return name; |
+ if (job_title_.empty()) { |
+ string16 name(tab_contents()->GetTitle()); |
+ if (name.empty()) |
+ job_title_ = l10n_util::GetStringUTF16(IDS_DEFAULT_PRINT_DOCUMENT_TITLE); |
+ else |
+ job_title_ = name; |
+ } |
+ return job_title_; |
} |
GURL PrintViewManager::RenderSourceUrl() { |
@@ -74,10 +78,13 @@ GURL PrintViewManager::RenderSourceUrl() { |
return GURL(); |
} |
-void PrintViewManager::OnDidGetPrintedPagesCount(int cookie, int number_pages) { |
+void PrintViewManager::OnDidGetBasicPrintJobInfo( |
+ int cookie, int number_pages, const string16& job_title) { |
DCHECK_GT(cookie, 0); |
DCHECK_GT(number_pages, 0); |
number_pages_ = number_pages; |
+ job_title_ = job_title; |
+ |
if (!OpportunisticallyCreatePrintJob(cookie)) |
return; |
@@ -152,8 +159,8 @@ void PrintViewManager::OnDidPrintPage( |
bool PrintViewManager::OnMessageReceived(const IPC::Message& message) { |
bool handled = true; |
IPC_BEGIN_MESSAGE_MAP(PrintViewManager, message) |
- IPC_MESSAGE_HANDLER(PrintHostMsg_DidGetPrintedPagesCount, |
- OnDidGetPrintedPagesCount) |
+ IPC_MESSAGE_HANDLER(PrintHostMsg_DidGetBasicPrintJobInfo, |
+ OnDidGetBasicPrintJobInfo) |
IPC_MESSAGE_HANDLER(PrintHostMsg_DidPrintPage, OnDidPrintPage) |
IPC_MESSAGE_UNHANDLED(handled = false) |
IPC_END_MESSAGE_MAP() |