OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
12 #include "base/time.h" | 12 #include "base/time.h" |
13 #include "gfx/size.h" | 13 #include "gfx/size.h" |
14 #include "printing/native_metafile.h" | 14 #include "printing/native_metafile.h" |
15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h" | 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h" |
16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebViewClient.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebViewClient.h" |
17 | 17 |
18 #if defined(OS_MACOSX) | 18 #if defined(OS_MACOSX) || defined(OS_WIN) |
19 #include "base/shared_memory.h" | 19 #include "base/shared_memory.h" |
20 #endif // defined(OS_MACOSX) | 20 #endif // defined(OS_MACOSX) || defined(OS_WIN) |
21 | 21 |
22 namespace gfx { | 22 namespace gfx { |
23 class Size; | 23 class Size; |
24 } | 24 } |
25 | 25 |
26 namespace IPC { | 26 namespace IPC { |
27 class Message; | 27 class Message; |
28 } | 28 } |
29 | 29 |
30 #if defined(USE_X11) | 30 #if defined(USE_X11) |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 | 174 |
175 // Render the frame for preview. | 175 // Render the frame for preview. |
176 void RenderPagesForPreview(WebKit::WebFrame* frame); | 176 void RenderPagesForPreview(WebKit::WebFrame* frame); |
177 void CreatePreviewDocument(const ViewMsg_PrintPages_Params& params, | 177 void CreatePreviewDocument(const ViewMsg_PrintPages_Params& params, |
178 WebKit::WebFrame* frame, | 178 WebKit::WebFrame* frame, |
179 ViewHostMsg_DidPreviewDocument_Params* print_params); | 179 ViewHostMsg_DidPreviewDocument_Params* print_params); |
180 #if defined(OS_MACOSX) | 180 #if defined(OS_MACOSX) |
181 void RenderPage(const gfx::Size& page_size, const gfx::Point& content_origin, | 181 void RenderPage(const gfx::Size& page_size, const gfx::Point& content_origin, |
182 const float& scale_factor, int page_number, | 182 const float& scale_factor, int page_number, |
183 WebKit::WebFrame* frame, printing::NativeMetafile* metafile); | 183 WebKit::WebFrame* frame, printing::NativeMetafile* metafile); |
| 184 #elif defined(OS_WIN) |
| 185 void RenderPage(const gfx::Size& page_size, float* scale_factor, |
| 186 int page_number, WebKit::WebFrame* frame, |
| 187 scoped_ptr<printing::NativeMetafile>* metafile, |
| 188 bool supports_alpha_blend); |
| 189 #endif |
| 190 |
| 191 #if defined(OS_MACOSX) || defined(OS_WIN) |
184 bool CopyMetafileDataToSharedMem(printing::NativeMetafile* metafile, | 192 bool CopyMetafileDataToSharedMem(printing::NativeMetafile* metafile, |
185 base::SharedMemoryHandle* shared_mem_handle); | 193 base::SharedMemoryHandle* shared_mem_handle); |
186 #endif | 194 #endif |
187 | 195 |
188 RenderView* render_view_; | 196 RenderView* render_view_; |
189 WebKit::WebView* print_web_view_; | 197 WebKit::WebView* print_web_view_; |
190 scoped_ptr<ViewMsg_PrintPages_Params> print_pages_params_; | 198 scoped_ptr<ViewMsg_PrintPages_Params> print_pages_params_; |
191 base::Time last_cancelled_script_print_; | 199 base::Time last_cancelled_script_print_; |
192 int user_cancelled_scripted_print_count_; | 200 int user_cancelled_scripted_print_count_; |
193 bool is_preview_; | 201 bool is_preview_; |
194 | 202 |
195 private: | 203 private: |
196 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); | 204 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); |
197 }; | 205 }; |
198 | 206 |
199 #endif // CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ | 207 #endif // CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ |
OLD | NEW |