| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ | 5 #ifndef CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ |
| 6 #define CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ | 6 #define CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/gfx/size.h" | 10 #include "base/gfx/size.h" |
| 11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
| 12 #include "base/time.h" | 12 #include "base/time.h" |
| 13 #include "webkit/glue/webview_delegate.h" | 13 #include "webkit/glue/webview_delegate.h" |
| 14 | 14 |
| 15 namespace gfx { | 15 namespace gfx { |
| 16 class Size; | 16 class Size; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace IPC { | 19 namespace IPC { |
| 20 class Message; | 20 class Message; |
| 21 } | 21 } |
| 22 | 22 |
| 23 #if defined(OS_LINUX) | 23 #if defined(USE_X11) |
| 24 namespace printing { | 24 namespace printing { |
| 25 class PdfPsMetafile; | 25 class PdfPsMetafile; |
| 26 typedef PdfPsMetafile NativeMetafile; | 26 typedef PdfPsMetafile NativeMetafile; |
| 27 } | 27 } |
| 28 #endif | 28 #endif |
| 29 | 29 |
| 30 class RenderView; | 30 class RenderView; |
| 31 class WebView; | 31 class WebView; |
| 32 struct ViewMsg_Print_Params; | 32 struct ViewMsg_Print_Params; |
| 33 struct ViewMsg_PrintPage_Params; | 33 struct ViewMsg_PrintPage_Params; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 void PrintPageAsJPEG(const ViewMsg_PrintPage_Params& params, | 88 void PrintPageAsJPEG(const ViewMsg_PrintPage_Params& params, |
| 89 WebKit::WebFrame* frame, | 89 WebKit::WebFrame* frame, |
| 90 float zoom_factor, | 90 float zoom_factor, |
| 91 std::vector<unsigned char>* image_data); | 91 std::vector<unsigned char>* image_data); |
| 92 | 92 |
| 93 protected: | 93 protected: |
| 94 bool CopyAndPrint(const ViewMsg_PrintPages_Params& params, | 94 bool CopyAndPrint(const ViewMsg_PrintPages_Params& params, |
| 95 WebKit::WebFrame* web_frame); | 95 WebKit::WebFrame* web_frame); |
| 96 | 96 |
| 97 // Prints the page listed in |params|. | 97 // Prints the page listed in |params|. |
| 98 #if defined(OS_LINUX) | 98 #if defined(USE_X11) |
| 99 void PrintPage(const ViewMsg_PrintPage_Params& params, | 99 void PrintPage(const ViewMsg_PrintPage_Params& params, |
| 100 const gfx::Size& canvas_size, | 100 const gfx::Size& canvas_size, |
| 101 WebKit::WebFrame* frame, | 101 WebKit::WebFrame* frame, |
| 102 printing::NativeMetafile* metafile); | 102 printing::NativeMetafile* metafile); |
| 103 #else | 103 #else |
| 104 void PrintPage(const ViewMsg_PrintPage_Params& params, | 104 void PrintPage(const ViewMsg_PrintPage_Params& params, |
| 105 const gfx::Size& canvas_size, | 105 const gfx::Size& canvas_size, |
| 106 WebKit::WebFrame* frame); | 106 WebKit::WebFrame* frame); |
| 107 #endif | 107 #endif |
| 108 | 108 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 137 scoped_ptr<WebView> print_web_view_; | 137 scoped_ptr<WebView> print_web_view_; |
| 138 scoped_ptr<ViewMsg_PrintPages_Params> print_pages_params_; | 138 scoped_ptr<ViewMsg_PrintPages_Params> print_pages_params_; |
| 139 base::Time last_cancelled_script_print_; | 139 base::Time last_cancelled_script_print_; |
| 140 int user_cancelled_scripted_print_count_; | 140 int user_cancelled_scripted_print_count_; |
| 141 | 141 |
| 142 private: | 142 private: |
| 143 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); | 143 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); |
| 144 }; | 144 }; |
| 145 | 145 |
| 146 #endif // CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ | 146 #endif // CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ |
| OLD | NEW |