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

Side by Side Diff: printing/print_destination_win.cc

Issue 10483006: Print support for Windows Metro... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync'd to ToT... Created 8 years, 5 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/print_destination_none.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
(Empty)
1 // Copyright (c) 2012 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/print_destination_interface.h"
6
7 #include "base/win/metro.h"
8
9 namespace printing {
10
11 class PrintDestinationWin : public PrintDestinationInterface {
12 public:
13 PrintDestinationWin()
14 : metro_set_print_page_count_(NULL),
15 metro_set_print_page_content_(NULL) {
16 HMODULE metro_module = base::win::GetMetroModule();
17 if (metro_module != NULL) {
18 metro_set_print_page_count_ =
19 reinterpret_cast<MetroSetPrintPageCount>(
20 ::GetProcAddress(metro_module, "MetroSetPrintPageCount"));
21 metro_set_print_page_content_ =
22 reinterpret_cast<MetroSetPrintPageContent>(
23 ::GetProcAddress(metro_module, "MetroSetPrintPageContent"));
24 }
25 }
26 virtual void SetPageCount(int page_count) {
27 if (metro_set_print_page_count_)
28 metro_set_print_page_count_(page_count);
29 }
30
31 virtual void SetPageContent(int page_number,
32 void* content,
33 size_t content_size) {
34 if (metro_set_print_page_content_)
35 metro_set_print_page_content_(page_number - 1, content, content_size);
36 }
37 private:
38 typedef void (*MetroSetPrintPageCount)(INT);
39 typedef void (*MetroSetPrintPageContent)(INT, VOID*, UINT32);
40 MetroSetPrintPageCount metro_set_print_page_count_;
41 MetroSetPrintPageContent metro_set_print_page_content_;
42 };
43
44 PrintDestinationInterface* CreatePrintDestination() {
45 // We currently only support the Metro print destination.
46 if (base::win::IsMetroProcess())
47 return new PrintDestinationWin;
48 else
49 return NULL;
50 }
51
52 } // namespace printing
OLDNEW
« no previous file with comments | « printing/print_destination_none.cc ('k') | printing/printing.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698