| 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 CHROME_RENDERER_WEBPLUGIN_DELEGATE_PEPPER_H_ | 5 #ifndef CHROME_RENDERER_WEBPLUGIN_DELEGATE_PEPPER_H_ |
| 6 #define CHROME_RENDERER_WEBPLUGIN_DELEGATE_PEPPER_H_ | 6 #define CHROME_RENDERER_WEBPLUGIN_DELEGATE_PEPPER_H_ |
| 7 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 // Closes down and destroys our plugin instance. | 217 // Closes down and destroys our plugin instance. |
| 218 void DestroyInstance(); | 218 void DestroyInstance(); |
| 219 | 219 |
| 220 void ForwardSetWindow(); | 220 void ForwardSetWindow(); |
| 221 | 221 |
| 222 // A helper method that invokes the plugin's Print extensions to calculate | 222 // A helper method that invokes the plugin's Print extensions to calculate |
| 223 // the size needed in pixels to render the given page in a raster format. | 223 // the size needed in pixels to render the given page in a raster format. |
| 224 bool CalculatePrintedPageDimensions(int page_number, | 224 bool CalculatePrintedPageDimensions(int page_number, |
| 225 NPPPrintExtensions* print_extensions, | 225 NPPPrintExtensions* print_extensions, |
| 226 gfx::Size* page_dimensions); | 226 gfx::Size* page_dimensions); |
| 227 bool VectorPrintPage(int page_number, WebKit::WebCanvas* canvas); |
| 228 |
| 227 NPPPrintExtensions* GetPrintExtensions(); | 229 NPPPrintExtensions* GetPrintExtensions(); |
| 228 | 230 |
| 229 NPPFindExtensions* GetFindExtensions(); | 231 NPPFindExtensions* GetFindExtensions(); |
| 230 | 232 |
| 231 #if defined(OS_WIN) | 233 #if defined(OS_WIN) |
| 232 // Compresses the given bitmap as JPEG and draws it into the backing platform | 234 // Compresses the given bitmap as JPEG and draws it into the backing platform |
| 233 // DC (Windows-only). | 235 // DC (Windows-only). |
| 234 bool DrawJPEGToPlatformDC(const SkBitmap& bitmap, | 236 bool DrawJPEGToPlatformDC(const SkBitmap& bitmap, |
| 235 const gfx::Rect& printable_area, | 237 const gfx::Rect& printable_area, |
| 236 WebKit::WebCanvas* canvas); | 238 WebKit::WebCanvas* canvas); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 // The url with which the plugin was instantiated. | 287 // The url with which the plugin was instantiated. |
| 286 std::string plugin_url_; | 288 std::string plugin_url_; |
| 287 | 289 |
| 288 // The nested GPU plugin. | 290 // The nested GPU plugin. |
| 289 WebPluginDelegateProxy* nested_delegate_; | 291 WebPluginDelegateProxy* nested_delegate_; |
| 290 | 292 |
| 291 // The last printable_area passed in to PrintBegin. We remember this because | 293 // The last printable_area passed in to PrintBegin. We remember this because |
| 292 // we need to stretch the printed raster bitmap to these dimensions. It is | 294 // we need to stretch the printed raster bitmap to these dimensions. It is |
| 293 // cleared in PrintEnd. | 295 // cleared in PrintEnd. |
| 294 gfx::Rect current_printable_area_; | 296 gfx::Rect current_printable_area_; |
| 297 int current_printer_dpi_; |
| 295 #if defined(OS_MACOSX) | 298 #if defined(OS_MACOSX) |
| 296 // On the Mac, when we draw the bitmap to the PDFContext, it seems necessary | 299 // On the Mac, when we draw the bitmap to the PDFContext, it seems necessary |
| 297 // to keep the pixels valis until CGContextEndPage is called. We use this | 300 // to keep the pixels valis until CGContextEndPage is called. We use this |
| 298 // variable to hold on to the pixels. | 301 // variable to hold on to the pixels. |
| 299 SkBitmap last_printed_page_; | 302 SkBitmap last_printed_page_; |
| 300 #endif // defined(OS_MACOSX) | 303 #endif // defined(OS_MACOSX) |
| 301 | 304 |
| 302 #if defined(ENABLE_GPU) | 305 #if defined(ENABLE_GPU) |
| 303 // The command buffer used to issue commands to the nested GPU plugin. | 306 // The command buffer used to issue commands to the nested GPU plugin. |
| 304 CommandBufferProxy* command_buffer_; | 307 CommandBufferProxy* command_buffer_; |
| 305 #endif | 308 #endif |
| 306 | 309 |
| 307 // The id of the current find operation, or -1 if none is in process. | 310 // The id of the current find operation, or -1 if none is in process. |
| 308 int find_identifier_; | 311 int find_identifier_; |
| 309 | 312 |
| 310 // Runnable methods that must be cancelled when the 3D context is destroyed. | 313 // Runnable methods that must be cancelled when the 3D context is destroyed. |
| 311 ScopedRunnableMethodFactory<WebPluginDelegatePepper> method_factory3d_; | 314 ScopedRunnableMethodFactory<WebPluginDelegatePepper> method_factory3d_; |
| 312 | 315 |
| 313 // When a choose file operation is outstanding, this will contain a | 316 // When a choose file operation is outstanding, this will contain a |
| 314 // pointer to the callback specified by the plugin. Will be NULL otherwise. | 317 // pointer to the callback specified by the plugin. Will be NULL otherwise. |
| 315 NPChooseFileCallback current_choose_file_callback_; | 318 NPChooseFileCallback current_choose_file_callback_; |
| 316 void* current_choose_file_user_data_; | 319 void* current_choose_file_user_data_; |
| 317 | 320 |
| 318 scoped_ptr<WebKit::WebCursorInfo> cursor_; | 321 scoped_ptr<WebKit::WebCursorInfo> cursor_; |
| 319 | 322 |
| 320 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegatePepper); | 323 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegatePepper); |
| 321 }; | 324 }; |
| 322 | 325 |
| 323 #endif // CHROME_RENDERER_WEBPLUGIN_DELEGATE_PEPPER_H_ | 326 #endif // CHROME_RENDERER_WEBPLUGIN_DELEGATE_PEPPER_H_ |
| OLD | NEW |