OLD | NEW |
---|---|
1 // Copyright (c) 2011 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 WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ |
6 #define WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
427 | 427 |
428 // This is only valid between a successful PrintBegin call and a PrintEnd | 428 // This is only valid between a successful PrintBegin call and a PrintEnd |
429 // call. | 429 // call. |
430 PP_PrintSettings_Dev current_print_settings_; | 430 PP_PrintSettings_Dev current_print_settings_; |
431 #if defined(OS_MACOSX) | 431 #if defined(OS_MACOSX) |
432 // On the Mac, when we draw the bitmap to the PDFContext, it seems necessary | 432 // On the Mac, when we draw the bitmap to the PDFContext, it seems necessary |
433 // to keep the pixels valid until CGContextEndPage is called. We use this | 433 // to keep the pixels valid until CGContextEndPage is called. We use this |
434 // variable to hold on to the pixels. | 434 // variable to hold on to the pixels. |
435 scoped_refptr<PPB_ImageData_Impl> last_printed_page_; | 435 scoped_refptr<PPB_ImageData_Impl> last_printed_page_; |
436 #endif // defined(OS_MACOSX) | 436 #endif // defined(OS_MACOSX) |
437 #if defined(OS_LINUX) || defined(OS_WIN) | 437 #if defined(USE_SKIA) |
438 // When printing to PDF (print preview, Linux) the entire document goes into | 438 // On all platforms, when printing to PDF using print preview workflow, |
vandebo (ex-Chrome)
2011/09/26 21:01:45
Always when printing on Linux, and when printing f
kmadhusu
2011/09/27 00:35:14
Done.
| |
439 // one metafile. However, when users print only a subset of all the pages, | 439 // the entire document goes into one metafile. However, when users print |
440 // it is impossible to know if a call to PrintPage() is the last call. | 440 // only a subset of all the pages, it is impossible to know if a call to |
441 // Thus in PrintPage(), just store the page number in |ranges_|. | 441 // PrintPage() is the last call. Thus in PrintPage(), just store the page |
442 // The hack is in PrintEnd(), where a valid |canvas_| is preserved in | 442 // number in |ranges_|. The hack is in PrintEnd(), where a valid |canvas_| |
443 // PrintWebViewHelper::PrintPages. This makes it possible to generate the | 443 // is preserved in PrintWebViewHelper::PrintPages. This makes it possible |
444 // entire PDF given the variables below: | 444 // to generate the entire PDF given the variables below: |
445 // | 445 // |
446 // The most recently used WebCanvas, guaranteed to be valid. | 446 // The most recently used WebCanvas, guaranteed to be valid. |
447 SkRefPtr<WebKit::WebCanvas> canvas_; | 447 SkRefPtr<WebKit::WebCanvas> canvas_; |
448 // An array of page ranges. | 448 // An array of page ranges. |
449 std::vector<PP_PrintPageNumberRange_Dev> ranges_; | 449 std::vector<PP_PrintPageNumberRange_Dev> ranges_; |
450 #endif // OS_LINUX || OS_WIN | 450 #endif // OS_LINUX || OS_WIN |
451 | 451 |
452 // The plugin print interface. | 452 // The plugin print interface. |
453 const PPP_Printing_Dev* plugin_print_interface_; | 453 const PPP_Printing_Dev* plugin_print_interface_; |
454 | 454 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
487 | 487 |
488 PP_CompletionCallback lock_mouse_callback_; | 488 PP_CompletionCallback lock_mouse_callback_; |
489 | 489 |
490 DISALLOW_COPY_AND_ASSIGN(PluginInstance); | 490 DISALLOW_COPY_AND_ASSIGN(PluginInstance); |
491 }; | 491 }; |
492 | 492 |
493 } // namespace ppapi | 493 } // namespace ppapi |
494 } // namespace webkit | 494 } // namespace webkit |
495 | 495 |
496 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | 496 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ |
OLD | NEW |