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

Side by Side Diff: printing/native_metafile_factory.cc

Issue 6826027: Connect the right metafiles for print preview on Linux and Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile problems Created 9 years, 8 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/native_metafile_factory.h ('k') | printing/native_metafile_skia_wrapper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "printing/native_metafile_factory.h"
6
7 #include "base/memory/scoped_ptr.h"
8
9 #if defined(OS_WIN)
10 #include "printing/emf_win.h"
11 #elif defined(OS_MACOSX)
12 #include "printing/pdf_metafile_cg_mac.h"
13 #elif defined(OS_POSIX)
14 #include "printing/pdf_metafile_cairo_linux.h"
15 #endif
16
17 namespace printing {
18
19 // static
20 NativeMetafile* NativeMetafileFactory::Create() {
21 scoped_ptr<NativeMetafile> metafile(CreateNewMetafile());
22 if (!metafile->Init())
23 return NULL;
24 return metafile.release();
25 }
26
27 // static
28 NativeMetafile* NativeMetafileFactory::CreateFromData(
29 const void* src_buffer, uint32 src_buffer_size) {
30 scoped_ptr<NativeMetafile> metafile(CreateNewMetafile());
31 if (!metafile->InitFromData(src_buffer, src_buffer_size))
32 return NULL;
33 return metafile.release();
34 }
35
36 // static
37 NativeMetafile* NativeMetafileFactory::CreateNewMetafile(){
38 #if defined(OS_WIN)
39 return new printing::Emf;
40 #elif defined(OS_MACOSX)
41 return new printing::PdfMetafileCg;
42 #elif defined(OS_POSIX)
43 return new printing::PdfMetafileCairo;
44 #endif
45 }
46
47 } // namespace printing
OLDNEW
« no previous file with comments | « printing/native_metafile_factory.h ('k') | printing/native_metafile_skia_wrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698