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

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

Issue 30443003: Use JS Date().toLocaleDateString() to format date in header. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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/mock_printer.cc ('k') | printing/print_settings.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 1465 matching lines...) Expand 10 before | Expand all | Expand 10 after
1476 } 1476 }
1477 1477
1478 settings.params.print_to_pdf = IsPrintToPdfRequested(*job_settings); 1478 settings.params.print_to_pdf = IsPrintToPdfRequested(*job_settings);
1479 UpdateFrameMarginsCssInfo(*job_settings); 1479 UpdateFrameMarginsCssInfo(*job_settings);
1480 settings.params.print_scaling_option = GetPrintScalingOption( 1480 settings.params.print_scaling_option = GetPrintScalingOption(
1481 source_is_html, *job_settings, settings.params); 1481 source_is_html, *job_settings, settings.params);
1482 1482
1483 // Header/Footer: Set |header_footer_info_|. 1483 // Header/Footer: Set |header_footer_info_|.
1484 if (settings.params.display_header_footer) { 1484 if (settings.params.display_header_footer) {
1485 header_footer_info_.reset(new base::DictionaryValue()); 1485 header_footer_info_.reset(new base::DictionaryValue());
1486 header_footer_info_->SetString(kSettingHeaderFooterDate, 1486 header_footer_info_->SetDouble(kSettingHeaderFooterDate,
1487 settings.params.date); 1487 base::Time::Now().ToJsTime());
1488 header_footer_info_->SetString(kSettingHeaderFooterURL, 1488 header_footer_info_->SetString(kSettingHeaderFooterURL,
1489 settings.params.url); 1489 settings.params.url);
1490 header_footer_info_->SetString(kSettingHeaderFooterTitle, 1490 header_footer_info_->SetString(kSettingHeaderFooterTitle,
1491 settings.params.title); 1491 settings.params.title);
1492 } 1492 }
1493 } 1493 }
1494 1494
1495 print_pages_params_.reset(new PrintMsg_PrintPages_Params(settings)); 1495 print_pages_params_.reset(new PrintMsg_PrintPages_Params(settings));
1496 Send(new PrintHostMsg_DidGetDocumentCookie(routing_id(), 1496 Send(new PrintHostMsg_DidGetDocumentCookie(routing_id(),
1497 settings.params.document_cookie)); 1497 settings.params.document_cookie));
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
1964 } 1964 }
1965 1965
1966 void PrintWebViewHelper::PrintPreviewContext::ClearContext() { 1966 void PrintWebViewHelper::PrintPreviewContext::ClearContext() {
1967 prep_frame_view_.reset(); 1967 prep_frame_view_.reset();
1968 metafile_.reset(); 1968 metafile_.reset();
1969 pages_to_render_.clear(); 1969 pages_to_render_.clear();
1970 error_ = PREVIEW_ERROR_NONE; 1970 error_ = PREVIEW_ERROR_NONE;
1971 } 1971 }
1972 1972
1973 } // namespace printing 1973 } // namespace printing
OLDNEW
« no previous file with comments | « chrome/renderer/mock_printer.cc ('k') | printing/print_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698