| 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 filename += date(); | 244 filename += date(); |
| 245 filename += ASCIIToUTF16("_"); | 245 filename += ASCIIToUTF16("_"); |
| 246 filename += time(); | 246 filename += time(); |
| 247 filename += ASCIIToUTF16("_"); | 247 filename += ASCIIToUTF16("_"); |
| 248 filename += name(); | 248 filename += name(); |
| 249 filename += ASCIIToUTF16("_"); | 249 filename += ASCIIToUTF16("_"); |
| 250 filename += ASCIIToUTF16(StringPrintf("%02d", page.page_number())); | 250 filename += ASCIIToUTF16(StringPrintf("%02d", page.page_number())); |
| 251 filename += ASCIIToUTF16("_.emf"); | 251 filename += ASCIIToUTF16("_.emf"); |
| 252 #if defined(OS_WIN) | 252 #if defined(OS_WIN) |
| 253 page.native_metafile()->SaveTo( | 253 page.native_metafile()->SaveTo( |
| 254 g_debug_dump_info.Get().debug_dump_path.Append(filename).ToWStringHack()); | 254 g_debug_dump_info.Get().debug_dump_path.Append(filename).value()); |
| 255 #else // OS_WIN | 255 #else // OS_WIN |
| 256 NOTIMPLEMENTED(); | 256 NOTIMPLEMENTED(); // TODO: convert SaveTo to accept a FilePath |
| 257 #endif // OS_WIN | 257 #endif // OS_WIN |
| 258 } | 258 } |
| 259 | 259 |
| 260 void PrintedDocument::set_debug_dump_path(const FilePath& debug_dump_path) { | 260 void PrintedDocument::set_debug_dump_path(const FilePath& debug_dump_path) { |
| 261 g_debug_dump_info.Get().enabled = !debug_dump_path.empty(); | 261 g_debug_dump_info.Get().enabled = !debug_dump_path.empty(); |
| 262 g_debug_dump_info.Get().debug_dump_path = debug_dump_path; | 262 g_debug_dump_info.Get().debug_dump_path = debug_dump_path; |
| 263 } | 263 } |
| 264 | 264 |
| 265 const FilePath& PrintedDocument::debug_dump_path() { | 265 const FilePath& PrintedDocument::debug_dump_path() { |
| 266 return g_debug_dump_info.Get().debug_dump_path; | 266 return g_debug_dump_info.Get().debug_dump_path; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 284 name_(source->RenderSourceName()), | 284 name_(source->RenderSourceName()), |
| 285 url_(source->RenderSourceUrl()), | 285 url_(source->RenderSourceUrl()), |
| 286 cookie_(cookie) { | 286 cookie_(cookie) { |
| 287 SetDocumentDate(); | 287 SetDocumentDate(); |
| 288 } | 288 } |
| 289 | 289 |
| 290 PrintedDocument::Immutable::~Immutable() { | 290 PrintedDocument::Immutable::~Immutable() { |
| 291 } | 291 } |
| 292 | 292 |
| 293 } // namespace printing | 293 } // namespace printing |
| OLD | NEW |