[email protected] | a46cb343 | 2014-06-18 12:05:09 | [diff] [blame] | 1 | // Copyright 2014 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 | #ifndef CHROME_UTILITY_PRINTING_HANDLER_H_ | ||||
6 | #define CHROME_UTILITY_PRINTING_HANDLER_H_ | ||||
7 | |||||
Jay Civelli | 80a982a | 2017-12-07 19:18:08 | [diff] [blame] | 8 | #include <string> |
9 | |||||
[email protected] | a46cb343 | 2014-06-18 12:05:09 | [diff] [blame] | 10 | #include "base/macros.h" |
avi | 2729e44 | 2015-12-26 05:27:45 | [diff] [blame] | 11 | #include "build/build_config.h" |
Scott Violet | 318a55f | 2018-03-30 19:08:19 | [diff] [blame] | 12 | #include "printing/buildflags/buildflags.h" |
[email protected] | a46cb343 | 2014-06-18 12:05:09 | [diff] [blame] | 13 | |
Lei Zhang | 21b7a81 | 2018-02-12 23:17:42 | [diff] [blame] | 14 | #if !defined(OS_WIN) || !BUILDFLAG(ENABLE_PRINT_PREVIEW) |
15 | #error "Windows printing and print preview must be enabled" | ||||
[email protected] | a46cb343 | 2014-06-18 12:05:09 | [diff] [blame] | 16 | #endif |
17 | |||||
Lei Zhang | 21b7a81 | 2018-02-12 23:17:42 | [diff] [blame] | 18 | namespace IPC { |
19 | class Message; | ||||
20 | } | ||||
21 | |||||
[email protected] | a46cb343 | 2014-06-18 12:05:09 | [diff] [blame] | 22 | namespace printing { |
thestig | 4567965 | 2015-12-09 02:15:19 | [diff] [blame] | 23 | |
[email protected] | a46cb343 | 2014-06-18 12:05:09 | [diff] [blame] | 24 | // Dispatches IPCs for printing. |
Lei Zhang | 21b7a81 | 2018-02-12 23:17:42 | [diff] [blame] | 25 | class PrintingHandler { |
[email protected] | a46cb343 | 2014-06-18 12:05:09 | [diff] [blame] | 26 | public: |
27 | PrintingHandler(); | ||||
Lei Zhang | 21b7a81 | 2018-02-12 23:17:42 | [diff] [blame] | 28 | ~PrintingHandler(); |
[email protected] | a46cb343 | 2014-06-18 12:05:09 | [diff] [blame] | 29 | |
Lei Zhang | 21b7a81 | 2018-02-12 23:17:42 | [diff] [blame] | 30 | bool OnMessageReceived(const IPC::Message& message); |
[email protected] | a46cb343 | 2014-06-18 12:05:09 | [diff] [blame] | 31 | |
32 | private: | ||||
33 | // IPC message handlers. | ||||
[email protected] | a46cb343 | 2014-06-18 12:05:09 | [diff] [blame] | 34 | void OnGetPrinterCapsAndDefaults(const std::string& printer_name); |
35 | void OnGetPrinterSemanticCapsAndDefaults(const std::string& printer_name); | ||||
[email protected] | a46cb343 | 2014-06-18 12:05:09 | [diff] [blame] | 36 | |
[email protected] | a46cb343 | 2014-06-18 12:05:09 | [diff] [blame] | 37 | DISALLOW_COPY_AND_ASSIGN(PrintingHandler); |
38 | }; | ||||
39 | |||||
thestig | 4567965 | 2015-12-09 02:15:19 | [diff] [blame] | 40 | } // namespace printing |
41 | |||||
[email protected] | a46cb343 | 2014-06-18 12:05:09 | [diff] [blame] | 42 | #endif // CHROME_UTILITY_PRINTING_HANDLER_H_ |