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

Side by Side Diff: printing/printed_document.cc

Issue 6611032: Unifying NativeMetafile class interface (as much as possible) for Linux, Mac, Win (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Making virtual methods not virtual (for clang bots) Created 9 years, 9 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 | « printing/pdf_ps_metafile_cairo_unittest.cc ('k') | printing/printing.gyp » ('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) 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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 return; 254 return;
255 255
256 string16 filename; 256 string16 filename;
257 filename += date(); 257 filename += date();
258 filename += ASCIIToUTF16("_"); 258 filename += ASCIIToUTF16("_");
259 filename += time(); 259 filename += time();
260 filename += ASCIIToUTF16("_"); 260 filename += ASCIIToUTF16("_");
261 filename += name(); 261 filename += name();
262 filename += ASCIIToUTF16("_"); 262 filename += ASCIIToUTF16("_");
263 filename += ASCIIToUTF16(StringPrintf("%02d", page.page_number())); 263 filename += ASCIIToUTF16(StringPrintf("%02d", page.page_number()));
264 #if defined(OS_WIN)
264 filename += ASCIIToUTF16("_.emf"); 265 filename += ASCIIToUTF16("_.emf");
265 #if defined(OS_WIN)
266 page.native_metafile()->SaveTo( 266 page.native_metafile()->SaveTo(
267 g_debug_dump_info.Get().debug_dump_path.Append(filename).value()); 267 g_debug_dump_info.Get().debug_dump_path.Append(filename));
268 #else // OS_WIN 268 #else // OS_WIN
269 NOTIMPLEMENTED(); // TODO: convert SaveTo to accept a FilePath 269 filename += ASCIIToUTF16("_.pdf");
270 page.native_metafile()->SaveTo(
271 g_debug_dump_info.Get().debug_dump_path.Append(UTF16ToUTF8(filename)));
270 #endif // OS_WIN 272 #endif // OS_WIN
271 } 273 }
272 274
273 void PrintedDocument::set_debug_dump_path(const FilePath& debug_dump_path) { 275 void PrintedDocument::set_debug_dump_path(const FilePath& debug_dump_path) {
274 g_debug_dump_info.Get().enabled = !debug_dump_path.empty(); 276 g_debug_dump_info.Get().enabled = !debug_dump_path.empty();
275 g_debug_dump_info.Get().debug_dump_path = debug_dump_path; 277 g_debug_dump_info.Get().debug_dump_path = debug_dump_path;
276 } 278 }
277 279
278 const FilePath& PrintedDocument::debug_dump_path() { 280 const FilePath& PrintedDocument::debug_dump_path() {
279 return g_debug_dump_info.Get().debug_dump_path; 281 return g_debug_dump_info.Get().debug_dump_path;
(...skipping 20 matching lines...) Expand all
300 name_(source->RenderSourceName()), 302 name_(source->RenderSourceName()),
301 url_(source->RenderSourceUrl()), 303 url_(source->RenderSourceUrl()),
302 cookie_(cookie) { 304 cookie_(cookie) {
303 SetDocumentDate(); 305 SetDocumentDate();
304 } 306 }
305 307
306 PrintedDocument::Immutable::~Immutable() { 308 PrintedDocument::Immutable::~Immutable() {
307 } 309 }
308 310
309 } // namespace printing 311 } // namespace printing
OLDNEW
« no previous file with comments | « printing/pdf_ps_metafile_cairo_unittest.cc ('k') | printing/printing.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698