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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 | 459 |
460 // This is only valid between a successful PrintBegin call and a PrintEnd | 460 // This is only valid between a successful PrintBegin call and a PrintEnd |
461 // call. | 461 // call. |
462 PP_PrintSettings_Dev current_print_settings_; | 462 PP_PrintSettings_Dev current_print_settings_; |
463 #if defined(OS_MACOSX) | 463 #if defined(OS_MACOSX) |
464 // On the Mac, when we draw the bitmap to the PDFContext, it seems necessary | 464 // On the Mac, when we draw the bitmap to the PDFContext, it seems necessary |
465 // to keep the pixels valid until CGContextEndPage is called. We use this | 465 // to keep the pixels valid until CGContextEndPage is called. We use this |
466 // variable to hold on to the pixels. | 466 // variable to hold on to the pixels. |
467 scoped_refptr<PPB_ImageData_Impl> last_printed_page_; | 467 scoped_refptr<PPB_ImageData_Impl> last_printed_page_; |
468 #endif // defined(OS_MACOSX) | 468 #endif // defined(OS_MACOSX) |
469 #if defined(OS_LINUX) || defined(OS_WIN) | 469 #if defined(USE_SKIA) |
470 // When printing to PDF (print preview, Linux) the entire document goes into | 470 // Always when printing to PDF on Linux and when printing for preview on Mac |
471 // one metafile. However, when users print only a subset of all the pages, | 471 // and Win, the entire document goes into one metafile. However, when users |
472 // it is impossible to know if a call to PrintPage() is the last call. | 472 // print only a subset of all the pages, it is impossible to know if a call |
473 // Thus in PrintPage(), just store the page number in |ranges_|. | 473 // to PrintPage() is the last call. Thus in PrintPage(), just store the page |
474 // The hack is in PrintEnd(), where a valid |canvas_| is preserved in | 474 // number in |ranges_|. The hack is in PrintEnd(), where a valid |canvas_| |
475 // PrintWebViewHelper::PrintPages. This makes it possible to generate the | 475 // is preserved in PrintWebViewHelper::PrintPages. This makes it possible |
476 // entire PDF given the variables below: | 476 // to generate the entire PDF given the variables below: |
477 // | 477 // |
478 // The most recently used WebCanvas, guaranteed to be valid. | 478 // The most recently used WebCanvas, guaranteed to be valid. |
479 SkRefPtr<WebKit::WebCanvas> canvas_; | 479 SkRefPtr<WebKit::WebCanvas> canvas_; |
480 // An array of page ranges. | 480 // An array of page ranges. |
481 std::vector<PP_PrintPageNumberRange_Dev> ranges_; | 481 std::vector<PP_PrintPageNumberRange_Dev> ranges_; |
482 #endif // OS_LINUX || OS_WIN | 482 #endif // OS_LINUX || OS_WIN |
483 | 483 |
484 // The plugin print interface. | 484 // The plugin print interface. |
485 const PPP_Printing_Dev* plugin_print_interface_; | 485 const PPP_Printing_Dev* plugin_print_interface_; |
486 | 486 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 | 534 |
535 PP_CompletionCallback lock_mouse_callback_; | 535 PP_CompletionCallback lock_mouse_callback_; |
536 | 536 |
537 DISALLOW_COPY_AND_ASSIGN(PluginInstance); | 537 DISALLOW_COPY_AND_ASSIGN(PluginInstance); |
538 }; | 538 }; |
539 | 539 |
540 } // namespace ppapi | 540 } // namespace ppapi |
541 } // namespace webkit | 541 } // namespace webkit |
542 | 542 |
543 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | 543 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ |
OLD | NEW |