Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Side by Side Diff: webkit/plugins/ppapi/ppapi_plugin_instance.h

Issue 8052020: Revert 103021 - PrintPreview: Printing preview of a PDF on Mac with Skia only previews the last p... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « skia/ext/platform_device.cc ('k') | webkit/plugins/ppapi/ppapi_plugin_instance.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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(USE_SKIA) 469 #if defined(OS_LINUX) || defined(OS_WIN)
470 // Always when printing to PDF on Linux and when printing for preview on Mac 470 // When printing to PDF (print preview, Linux) the entire document goes into
471 // and Win, the entire document goes into one metafile. However, when users 471 // one metafile. However, when users print only a subset of all the pages,
472 // print only a subset of all the pages, it is impossible to know if a call 472 // it is impossible to know if a call to PrintPage() is the last call.
473 // to PrintPage() is the last call. Thus in PrintPage(), just store the page 473 // Thus in PrintPage(), just store the page number in |ranges_|.
474 // number in |ranges_|. The hack is in PrintEnd(), where a valid |canvas_| 474 // The hack is in PrintEnd(), where a valid |canvas_| is preserved in
475 // is preserved in PrintWebViewHelper::PrintPages. This makes it possible 475 // PrintWebViewHelper::PrintPages. This makes it possible to generate the
476 // to generate the entire PDF given the variables below: 476 // 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
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_
OLDNEW
« no previous file with comments | « skia/ext/platform_device.cc ('k') | webkit/plugins/ppapi/ppapi_plugin_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698