OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 return; | 249 return; |
250 | 250 |
251 string16 filename; | 251 string16 filename; |
252 filename += date(); | 252 filename += date(); |
253 filename += ASCIIToUTF16("_"); | 253 filename += ASCIIToUTF16("_"); |
254 filename += time(); | 254 filename += time(); |
255 filename += ASCIIToUTF16("_"); | 255 filename += ASCIIToUTF16("_"); |
256 filename += name(); | 256 filename += name(); |
257 filename += ASCIIToUTF16("_"); | 257 filename += ASCIIToUTF16("_"); |
258 filename += ASCIIToUTF16(StringPrintf("%02d", page.page_number())); | 258 filename += ASCIIToUTF16(StringPrintf("%02d", page.page_number())); |
| 259 #if defined(OS_WIN) |
259 filename += ASCIIToUTF16("_.emf"); | 260 filename += ASCIIToUTF16("_.emf"); |
260 #if defined(OS_WIN) | |
261 page.native_metafile()->SaveTo( | 261 page.native_metafile()->SaveTo( |
262 g_debug_dump_info.Get().debug_dump_path.Append(filename).value()); | 262 g_debug_dump_info.Get().debug_dump_path.Append(filename)); |
263 #else // OS_WIN | 263 #else // OS_WIN |
264 NOTIMPLEMENTED(); // TODO: convert SaveTo to accept a FilePath | 264 filename += ASCIIToUTF16("_.pdf"); |
| 265 page.native_metafile()->SaveTo( |
| 266 g_debug_dump_info.Get().debug_dump_path.Append(UTF16ToUTF8(filename))); |
265 #endif // OS_WIN | 267 #endif // OS_WIN |
266 } | 268 } |
267 | 269 |
268 void PrintedDocument::set_debug_dump_path(const FilePath& debug_dump_path) { | 270 void PrintedDocument::set_debug_dump_path(const FilePath& debug_dump_path) { |
269 g_debug_dump_info.Get().enabled = !debug_dump_path.empty(); | 271 g_debug_dump_info.Get().enabled = !debug_dump_path.empty(); |
270 g_debug_dump_info.Get().debug_dump_path = debug_dump_path; | 272 g_debug_dump_info.Get().debug_dump_path = debug_dump_path; |
271 } | 273 } |
272 | 274 |
273 const FilePath& PrintedDocument::debug_dump_path() { | 275 const FilePath& PrintedDocument::debug_dump_path() { |
274 return g_debug_dump_info.Get().debug_dump_path; | 276 return g_debug_dump_info.Get().debug_dump_path; |
(...skipping 17 matching lines...) Expand all Loading... |
292 name_(source->RenderSourceName()), | 294 name_(source->RenderSourceName()), |
293 url_(source->RenderSourceUrl()), | 295 url_(source->RenderSourceUrl()), |
294 cookie_(cookie) { | 296 cookie_(cookie) { |
295 SetDocumentDate(); | 297 SetDocumentDate(); |
296 } | 298 } |
297 | 299 |
298 PrintedDocument::Immutable::~Immutable() { | 300 PrintedDocument::Immutable::~Immutable() { |
299 } | 301 } |
300 | 302 |
301 } // namespace printing | 303 } // namespace printing |
OLD | NEW |