// Copyright (c) 2014 The Chromium Embedded Framework Authors. // Portions Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CEF_TESTS_CEFCLIENT_BROWSER_PRINT_HANDLER_GTK_H_ #define CEF_TESTS_CEFCLIENT_BROWSER_PRINT_HANDLER_GTK_H_ #pragma once #include #include "include/cef_print_handler.h" namespace client { class ClientPrintHandlerGtk : public CefPrintHandler { public: ClientPrintHandlerGtk(); virtual ~ClientPrintHandlerGtk(); // CefPrintHandler methods. void OnPrintStart(CefRefPtr browser) OVERRIDE; void OnPrintSettings(CefRefPtr browser, CefRefPtr settings, bool get_defaults) OVERRIDE; bool OnPrintDialog(CefRefPtr browser, bool has_selection, CefRefPtr callback) OVERRIDE; bool OnPrintJob(CefRefPtr browser, const CefString& document_name, const CefString& pdf_file_path, CefRefPtr callback) OVERRIDE; void OnPrintReset(CefRefPtr browser) OVERRIDE; CefSize GetPdfPaperSize(CefRefPtr browser, int device_units_per_inch) OVERRIDE; private: // Print handler. struct PrintHandler; PrintHandler* GetPrintHandler(CefRefPtr browser); // Map of browser ID to print handler. typedef std::map PrintHandlerMap; PrintHandlerMap print_handler_map_; IMPLEMENT_REFCOUNTING(ClientPrintHandlerGtk); DISALLOW_COPY_AND_ASSIGN(ClientPrintHandlerGtk); }; } // namespace client #endif // CEF_TESTS_CEFCLIENT_BROWSER_PRINT_HANDLER_GTK_H_