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