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

Unified Diff: chrome/renderer/print_web_view_helper.cc

Issue 6775013: PrintPreview: While printing the preview data, set the initiator tab title as print job name. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Updated the CL. Created 9 years, 9 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
Index: chrome/renderer/print_web_view_helper.cc
diff --git a/chrome/renderer/print_web_view_helper.cc b/chrome/renderer/print_web_view_helper.cc
index c13c403f4d750ffe3381cf17921ee97f6f9f72d2..8ecd416a2efeb8798019137e0052d6ca7f5359f4 100644
--- a/chrome/renderer/print_web_view_helper.cc
+++ b/chrome/renderer/print_web_view_helper.cc
@@ -15,6 +15,7 @@
#include "content/common/view_messages.h"
#include "content/renderer/render_view.h"
#include "grit/generated_resources.h"
+#include "printing/print_job_constants.h"
#include "printing/units.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
@@ -197,6 +198,8 @@ void PrintWebViewHelper::OnPrintForPrintPreview(
return;
}
+ job_settings.GetString(printing::kSettingPrintJobTitle, &job_title_);
+
// Render Pages for printing.
RenderPagesForPrint(pdf_frame, &pdf_element);
#endif
@@ -350,6 +353,7 @@ void PrintWebViewHelper::DidFinishPrinting(bool success) {
print_web_view_ = NULL;
}
print_pages_params_.reset();
+ job_title_.clear();
}
bool PrintWebViewHelper::CopyAndPrint(WebKit::WebFrame* web_frame) {
@@ -391,8 +395,9 @@ void PrintWebViewHelper::PrintPages(const PrintMsg_PrintPages_Params& params,
frame->view());
int page_count = prep_frame_view.GetExpectedPageCount();
- render_view()->Send(new PrintHostMsg_DidGetPrintedPagesCount(
- render_view()->routing_id(), printParams.document_cookie, page_count));
+ render_view()->Send(new PrintHostMsg_DidGetBasicPrintJobInfo(
+ render_view()->routing_id(), printParams.document_cookie, page_count,
+ job_title_));
if (!page_count)
return;

Powered by Google App Engine
This is Rietveld 408576698