| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "app/gfx/font.h" | 9 #include "app/gfx/font.h" |
| 10 #include "app/gfx/text_elider.h" | 10 #include "app/gfx/text_elider.h" |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 | 256 |
| 257 std::wstring filename; | 257 std::wstring filename; |
| 258 filename += date(); | 258 filename += date(); |
| 259 filename += L"_"; | 259 filename += L"_"; |
| 260 filename += time(); | 260 filename += time(); |
| 261 filename += L"_"; | 261 filename += L"_"; |
| 262 filename += name(); | 262 filename += name(); |
| 263 filename += L"_"; | 263 filename += L"_"; |
| 264 filename += StringPrintf(L"%02d", page.page_number()); | 264 filename += StringPrintf(L"%02d", page.page_number()); |
| 265 filename += L"_.emf"; | 265 filename += L"_.emf"; |
| 266 file_util::ReplaceIllegalCharacters(&filename, '_'); | 266 #if defined(OS_WIN) |
| 267 file_util::ReplaceIllegalCharactersInPath(&filename, '_'); |
| 268 #else |
| 269 std::string narrow_filename = WideToUTF8(filename); |
| 270 file_util::ReplaceIllegalCharactersInPath(&narrow_filename, '_'); |
| 271 filename = UTF8ToWide(narrow_filename); |
| 272 #endif |
| 267 std::wstring path(g_debug_dump_info->debug_dump_path); | 273 std::wstring path(g_debug_dump_info->debug_dump_path); |
| 268 file_util::AppendToPath(&path, filename); | 274 file_util::AppendToPath(&path, filename); |
| 269 #if defined(OS_WIN) | 275 #if defined(OS_WIN) |
| 270 page.native_metafile()->SaveTo(path); | 276 page.native_metafile()->SaveTo(path); |
| 271 #else // OS_WIN | 277 #else // OS_WIN |
| 272 NOTIMPLEMENTED(); | 278 NOTIMPLEMENTED(); |
| 273 #endif // OS_WIN | 279 #endif // OS_WIN |
| 274 } | 280 } |
| 275 | 281 |
| 276 void PrintedDocument::set_debug_dump_path(const std::wstring& debug_dump_path) { | 282 void PrintedDocument::set_debug_dump_path(const std::wstring& debug_dump_path) { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 305 date_ = win_util::FormatSystemDate(systemtime, std::wstring()); | 311 date_ = win_util::FormatSystemDate(systemtime, std::wstring()); |
| 306 time_ = win_util::FormatSystemTime(systemtime, std::wstring()); | 312 time_ = win_util::FormatSystemTime(systemtime, std::wstring()); |
| 307 #else // OS_WIN | 313 #else // OS_WIN |
| 308 Time now = Time::Now(); | 314 Time now = Time::Now(); |
| 309 date_ = base::TimeFormatShortDateNumeric(now); | 315 date_ = base::TimeFormatShortDateNumeric(now); |
| 310 time_ = base::TimeFormatTimeOfDay(now); | 316 time_ = base::TimeFormatTimeOfDay(now); |
| 311 #endif // OS_WIN | 317 #endif // OS_WIN |
| 312 } | 318 } |
| 313 | 319 |
| 314 } // namespace printing | 320 } // namespace printing |
| OLD | NEW |