| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "printing/printed_document.h" | 5 #include "printing/printed_document.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 return g_debug_dump_info->debug_dump_path; | 296 return g_debug_dump_info->debug_dump_path; |
| 297 } | 297 } |
| 298 | 298 |
| 299 PrintedDocument::Mutable::Mutable(PrintedPagesSource* source) | 299 PrintedDocument::Mutable::Mutable(PrintedPagesSource* source) |
| 300 : source_(source), | 300 : source_(source), |
| 301 expected_page_count_(0), | 301 expected_page_count_(0), |
| 302 page_count_(0), | 302 page_count_(0), |
| 303 shrink_factor(0) { | 303 shrink_factor(0) { |
| 304 } | 304 } |
| 305 | 305 |
| 306 PrintedDocument::Mutable::~Mutable() { |
| 307 } |
| 308 |
| 306 PrintedDocument::Immutable::Immutable(const PrintSettings& settings, | 309 PrintedDocument::Immutable::Immutable(const PrintSettings& settings, |
| 307 PrintedPagesSource* source, | 310 PrintedPagesSource* source, |
| 308 int cookie) | 311 int cookie) |
| 309 : settings_(settings), | 312 : settings_(settings), |
| 310 source_message_loop_(MessageLoop::current()), | 313 source_message_loop_(MessageLoop::current()), |
| 311 name_(source->RenderSourceName()), | 314 name_(source->RenderSourceName()), |
| 312 url_(source->RenderSourceUrl()), | 315 url_(source->RenderSourceUrl()), |
| 313 cookie_(cookie) { | 316 cookie_(cookie) { |
| 314 // Setup the document's date. | 317 // Setup the document's date. |
| 315 #if defined(OS_WIN) | 318 #if defined(OS_WIN) |
| 316 // On Windows, use the native time formatting for printing. | 319 // On Windows, use the native time formatting for printing. |
| 317 SYSTEMTIME systemtime; | 320 SYSTEMTIME systemtime; |
| 318 GetLocalTime(&systemtime); | 321 GetLocalTime(&systemtime); |
| 319 date_ = | 322 date_ = |
| 320 WideToUTF16Hack(win_util::FormatSystemDate(systemtime, std::wstring())); | 323 WideToUTF16Hack(win_util::FormatSystemDate(systemtime, std::wstring())); |
| 321 time_ = | 324 time_ = |
| 322 WideToUTF16Hack(win_util::FormatSystemTime(systemtime, std::wstring())); | 325 WideToUTF16Hack(win_util::FormatSystemTime(systemtime, std::wstring())); |
| 323 #else // OS_WIN | 326 #else // OS_WIN |
| 324 Time now = Time::Now(); | 327 Time now = Time::Now(); |
| 325 date_ = WideToUTF16Hack(base::TimeFormatShortDateNumeric(now)); | 328 date_ = WideToUTF16Hack(base::TimeFormatShortDateNumeric(now)); |
| 326 time_ = WideToUTF16Hack(base::TimeFormatTimeOfDay(now)); | 329 time_ = WideToUTF16Hack(base::TimeFormatTimeOfDay(now)); |
| 327 #endif // OS_WIN | 330 #endif // OS_WIN |
| 328 } | 331 } |
| 329 | 332 |
| 333 PrintedDocument::Immutable::~Immutable() { |
| 334 } |
| 335 |
| 330 } // namespace printing | 336 } // namespace printing |
| OLD | NEW |