1 // Copyright (c) 2014 The Chromium Embedded Framework Authors. 2 // Portions Copyright (c) 2012 The Chromium Authors. All rights reserved. 3 // Use of this source code is governed by a BSD-style license that can be 4 // found in the LICENSE file. 5 6 #ifndef CEF_TESTS_CEFCLIENT_BROWSER_PRINT_HANDLER_GTK_H_ 7 #define CEF_TESTS_CEFCLIENT_BROWSER_PRINT_HANDLER_GTK_H_ 8 #pragma once 9 10 #include <memory> 11 12 #include "include/cef_print_handler.h" 13 14 namespace client { 15 16 class ClientPrintHandlerGtk : public CefPrintHandler { 17 public: 18 ClientPrintHandlerGtk(); 19 virtual ~ClientPrintHandlerGtk(); 20 21 // CefPrintHandler methods. 22 void OnPrintStart(CefRefPtr<CefBrowser> browser) override; 23 void OnPrintSettings(CefRefPtr<CefBrowser> browser, 24 CefRefPtr<CefPrintSettings> settings, 25 bool get_defaults) override; 26 bool OnPrintDialog(CefRefPtr<CefBrowser> browser, 27 bool has_selection, 28 CefRefPtr<CefPrintDialogCallback> callback) override; 29 bool OnPrintJob(CefRefPtr<CefBrowser> browser, 30 const CefString& document_name, 31 const CefString& pdf_file_path, 32 CefRefPtr<CefPrintJobCallback> callback) override; 33 void OnPrintReset(CefRefPtr<CefBrowser> browser) override; 34 CefSize GetPdfPaperSize(CefRefPtr<CefBrowser> browser, 35 int device_units_per_inch) override; 36 37 private: 38 // Print handler. 39 struct PrintHandler; 40 std::unique_ptr<PrintHandler> print_handler_; 41 42 IMPLEMENT_REFCOUNTING(ClientPrintHandlerGtk); 43 DISALLOW_COPY_AND_ASSIGN(ClientPrintHandlerGtk); 44 }; 45 46 } // namespace client 47 48 #endif // CEF_TESTS_CEFCLIENT_BROWSER_PRINT_HANDLER_GTK_H_ 49