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

Side by Side Diff: chrome/renderer/printing/print_web_view_helper.cc

Issue 480303002: Use document from preview for System Dialog printing on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tue Aug 26 01:11:31 PDT 2014 Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/chrome_mock_render_thread.cc ('k') | printing/backend/win_helper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/printing/print_web_view_helper.h" 5 #include "chrome/renderer/printing/print_web_view_helper.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1446 matching lines...) Expand 10 before | Expand all | Expand 10 after
1457 modified_job_settings.SetBoolean(kSettingHeaderFooterEnabled, false); 1457 modified_job_settings.SetBoolean(kSettingHeaderFooterEnabled, false);
1458 modified_job_settings.SetInteger(kSettingMarginsType, NO_MARGINS); 1458 modified_job_settings.SetInteger(kSettingMarginsType, NO_MARGINS);
1459 job_settings = &modified_job_settings; 1459 job_settings = &modified_job_settings;
1460 } 1460 }
1461 1461
1462 // Send the cookie so that UpdatePrintSettings can reuse PrinterQuery when 1462 // Send the cookie so that UpdatePrintSettings can reuse PrinterQuery when
1463 // possible. 1463 // possible.
1464 int cookie = print_pages_params_ ? 1464 int cookie = print_pages_params_ ?
1465 print_pages_params_->params.document_cookie : 0; 1465 print_pages_params_->params.document_cookie : 0;
1466 PrintMsg_PrintPages_Params settings; 1466 PrintMsg_PrintPages_Params settings;
1467 bool canceled = false;
1467 Send(new PrintHostMsg_UpdatePrintSettings( 1468 Send(new PrintHostMsg_UpdatePrintSettings(
1468 routing_id(), cookie, *job_settings, &settings)); 1469 routing_id(), cookie, *job_settings, &settings, &canceled));
1470 if (canceled) {
1471 notify_browser_of_print_failure_ = false;
1472 return false;
1473 }
1469 1474
1470 if (!job_settings->GetInteger(kPreviewUIID, &settings.params.preview_ui_id)) { 1475 if (!job_settings->GetInteger(kPreviewUIID, &settings.params.preview_ui_id)) {
1471 NOTREACHED(); 1476 NOTREACHED();
1472 print_preview_context_.set_error(PREVIEW_ERROR_BAD_SETTING); 1477 print_preview_context_.set_error(PREVIEW_ERROR_BAD_SETTING);
1473 return false; 1478 return false;
1474 } 1479 }
1475 1480
1476 if (!print_for_preview_) { 1481 if (!print_for_preview_) {
1477 // Validate expected print preview settings. 1482 // Validate expected print preview settings.
1478 if (!job_settings->GetInteger(kPreviewRequestID, 1483 if (!job_settings->GetInteger(kPreviewRequestID,
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
1959 } 1964 }
1960 1965
1961 void PrintWebViewHelper::SetPrintPagesParams( 1966 void PrintWebViewHelper::SetPrintPagesParams(
1962 const PrintMsg_PrintPages_Params& settings) { 1967 const PrintMsg_PrintPages_Params& settings) {
1963 print_pages_params_.reset(new PrintMsg_PrintPages_Params(settings)); 1968 print_pages_params_.reset(new PrintMsg_PrintPages_Params(settings));
1964 Send(new PrintHostMsg_DidGetDocumentCookie(routing_id(), 1969 Send(new PrintHostMsg_DidGetDocumentCookie(routing_id(),
1965 settings.params.document_cookie)); 1970 settings.params.document_cookie));
1966 } 1971 }
1967 1972
1968 } // namespace printing 1973 } // namespace printing
OLDNEW
« no previous file with comments | « chrome/renderer/chrome_mock_render_thread.cc ('k') | printing/backend/win_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698