OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/print_destination_interface.h" | 5 #include "printing/print_destination_interface.h" |
6 | 6 |
7 #include "base/win/metro.h" | 7 #include "base/win/metro.h" |
| 8 #include "win8/util/win8_util.h" |
8 | 9 |
9 namespace printing { | 10 namespace printing { |
10 | 11 |
11 class PrintDestinationWin : public PrintDestinationInterface { | 12 class PrintDestinationWin : public PrintDestinationInterface { |
12 public: | 13 public: |
13 PrintDestinationWin() | 14 PrintDestinationWin() |
14 : metro_set_print_page_count_(NULL), | 15 : metro_set_print_page_count_(NULL), |
15 metro_set_print_page_content_(NULL) { | 16 metro_set_print_page_content_(NULL) { |
16 HMODULE metro_module = base::win::GetMetroModule(); | 17 HMODULE metro_module = base::win::GetMetroModule(); |
17 if (metro_module != NULL) { | 18 if (metro_module != NULL) { |
(...skipping 18 matching lines...) Expand all Loading... |
36 } | 37 } |
37 private: | 38 private: |
38 typedef void (*MetroSetPrintPageCount)(INT); | 39 typedef void (*MetroSetPrintPageCount)(INT); |
39 typedef void (*MetroSetPrintPageContent)(INT, VOID*, UINT32); | 40 typedef void (*MetroSetPrintPageContent)(INT, VOID*, UINT32); |
40 MetroSetPrintPageCount metro_set_print_page_count_; | 41 MetroSetPrintPageCount metro_set_print_page_count_; |
41 MetroSetPrintPageContent metro_set_print_page_content_; | 42 MetroSetPrintPageContent metro_set_print_page_content_; |
42 }; | 43 }; |
43 | 44 |
44 PrintDestinationInterface* CreatePrintDestination() { | 45 PrintDestinationInterface* CreatePrintDestination() { |
45 // We currently only support the Metro print destination. | 46 // We currently only support the Metro print destination. |
46 if (base::win::IsMetroProcess()) | 47 if (win8::IsSingleWindowMetroMode()) |
47 return new PrintDestinationWin; | 48 return new PrintDestinationWin; |
48 else | 49 else |
49 return NULL; | 50 return NULL; |
50 } | 51 } |
51 | 52 |
52 } // namespace printing | 53 } // namespace printing |
OLD | NEW |