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

Unified Diff: chrome/renderer/print_web_view_helper.cc

Issue 7313035: Print Preview: Associating preview requests and responses using an identifier (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressing comments Created 9 years, 5 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 1b2a509adabf5f29bf21ebda517216fefdc39316..3f79e2694441259b6b4945d6ca589b74fcdde46b 100644
--- a/chrome/renderer/print_web_view_helper.cc
+++ b/chrome/renderer/print_web_view_helper.cc
@@ -18,6 +18,7 @@
#include "content/renderer/render_view.h"
#include "grit/generated_resources.h"
#include "printing/metafile.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/WebDataSource.h"
@@ -378,6 +379,8 @@ void PrintWebViewHelper::PrintPreview(WebKit::WebFrame* frame,
print_pages_params_->params.document_cookie;
preview_params.expected_pages_count = preview_page_count_;
preview_params.modifiable = IsModifiable(frame, node);
+ settings.GetInteger(printing::kPreviewRequestID,
Lei Zhang 2011/07/12 23:19:30 Actually, why do we have to do this again here? Di
dpapad 2011/07/12 23:42:29 This handles the case when there is no rerendering
Lei Zhang 2011/07/12 23:58:40 We just called UpdatePrintSettings(), which should
dpapad 2011/07/13 00:15:45 Done, you are right, I confused the order of execu
+ &preview_params.preview_request_id);
Send(new PrintHostMsg_PagesReadyForPreview(routing_id(), preview_params));
return;
@@ -648,12 +651,20 @@ bool PrintWebViewHelper::InitPrintSettings(WebKit::WebFrame* frame,
bool PrintWebViewHelper::UpdatePrintSettings(
const DictionaryValue& job_settings) {
PrintMsg_PrintPages_Params settings;
+ if (!job_settings.GetInteger(printing::kPreviewRequestID,
+ &settings.params.preview_request_id)) {
+ NOTREACHED();
+ }
+
Send(new PrintHostMsg_UpdatePrintSettings(routing_id(),
print_pages_params_->params.document_cookie, job_settings, &settings));
if (!settings.params.dpi || !settings.params.document_cookie)
return false;
+ job_settings.GetInteger(printing::kPreviewRequestID,
+ &settings.params.preview_request_id);
dpapad 2011/07/12 23:02:11 I still have to do this, because it seems that |se
Lei Zhang 2011/07/12 23:19:30 Oh, in that case just ignore my comment about doin
dpapad 2011/07/12 23:42:29 Done.
+
print_pages_params_.reset(new PrintMsg_PrintPages_Params(settings));
Send(new PrintHostMsg_DidGetDocumentCookie(routing_id(),
settings.params.document_cookie));

Powered by Google App Engine
This is Rietveld 408576698