OLD | NEW |
| (Empty) |
1 // Copyright (c) 2010 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 WEBKIT_GLUE_PLUGINS_WEBPLUGIN_PRINT_DELEGATE_H_ | |
6 #define WEBKIT_GLUE_PLUGINS_WEBPLUGIN_PRINT_DELEGATE_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "third_party/npapi/bindings/npapi_extensions.h" | |
10 #include "third_party/WebKit/WebKit/chromium/public/WebCanvas.h" | |
11 | |
12 namespace gfx { | |
13 class Rect; | |
14 } | |
15 | |
16 namespace webkit_glue { | |
17 | |
18 // Interface for the NPAPI print extension. This class implements "NOP" | |
19 // versions of all these functions so it can be used seamlessly by the | |
20 // "regular" plugin delegate while being overridden by the "pepper" one. | |
21 class WebPluginPrintDelegate { | |
22 public: | |
23 // If a plugin supports print extensions, then it gets to participate fully | |
24 // in the browser's print workflow by specifying the number of pages to be | |
25 // printed and providing a print output for specified pages. | |
26 virtual bool PrintSupportsPrintExtension(); | |
27 | |
28 // Note: printable_area is in points (a point is 1/72 of an inch). | |
29 virtual int PrintBegin(const gfx::Rect& printable_area, int printer_dpi); | |
30 | |
31 virtual bool PrintPage(int page_number, WebKit::WebCanvas* canvas); | |
32 | |
33 virtual void PrintEnd(); | |
34 | |
35 protected: | |
36 WebPluginPrintDelegate() {} | |
37 virtual ~WebPluginPrintDelegate() {} | |
38 }; | |
39 | |
40 } // namespace webkit_glue | |
41 | |
42 #endif // WEBKIT_GLUE_PLUGINS_WEBPLUGIN_PRINT_DELEGATE_H_ | |
43 | |
OLD | NEW |