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

Unified Diff: chrome/renderer/printing/print_web_view_helper.h

Issue 12087005: Async frame preparation for Preview with support if selection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/printing/print_web_view_helper.h
diff --git a/chrome/renderer/printing/print_web_view_helper.h b/chrome/renderer/printing/print_web_view_helper.h
index f75885c763cdadc0da7fcc1b4a70fd94846b4f1f..517470a909330d8631a9a65bac0c8b5e9c392ebd 100644
--- a/chrome/renderer/printing/print_web_view_helper.h
+++ b/chrome/renderer/printing/print_web_view_helper.h
@@ -138,6 +138,12 @@ class PrintWebViewHelper
// Start the process of generating a print preview using |settings|.
void OnPrintPreview(const base::DictionaryValue& settings);
+ // Prepare frame for creating preview document.
+ void PrepareFrameForPreviewDocument();
+
+ // Continue creating preview document.
+ void OnFramePreparedForPreviewDocument();
+
// Initialize the print preview document.
bool CreatePreviewDocument();
@@ -352,9 +358,8 @@ class PrintWebViewHelper
void OnPrintPreview();
// Create the print preview document. |pages| is empty to print all pages.
- bool CreatePreviewDocument(const PrintMsg_Print_Params& params,
- const std::vector<int>& pages,
- bool ignore_css_margins);
+ bool CreatePreviewDocument(PrepareFrameAndViewForPrint* prepared_frame,
Lei Zhang 2013/01/26 08:40:36 Mention this takes ownership of |prepared_frame|.
Vitaly Buka (NO REVIEWS) 2013/01/26 10:29:30 Done.
+ const std::vector<int>& pages);
// Called after a page gets rendered. |page_time| is how long the
// rendering took.
@@ -376,6 +381,7 @@ class PrintWebViewHelper
int GetNextPageNumber();
bool IsRendering() const;
bool IsModifiable() const;
+ bool HasSelection() const;
bool IsLastPageOfPrintReadyMetafile() const;
bool IsFinalPageRendered() const;
@@ -384,8 +390,10 @@ class PrintWebViewHelper
void set_error(enum PrintPreviewErrorBuckets error);
// Getters
- WebKit::WebFrame* frame();
- const WebKit::WebNode& node() const;
+ WebKit::WebFrame* prepared_frame();
Lei Zhang 2013/01/26 08:40:36 Please mention the difference between the source a
Vitaly Buka (NO REVIEWS) 2013/01/26 10:29:30 Done.
+ const WebKit::WebNode& prepared_node() const;
+ WebKit::WebFrame* source_frame();
+ const WebKit::WebNode& source_node() const;
int total_page_count() const;
bool generate_draft_pages() const;
PreviewMetafile* metafile();
@@ -404,15 +412,12 @@ class PrintWebViewHelper
void ClearContext();
// Specifies what to render for print preview.
- WebKit::WebFrame* frame_;
- WebKit::WebNode node_;
+ WebKit::WebFrame* source_frame_;
+ WebKit::WebNode source_node_;
scoped_ptr<PrepareFrameAndViewForPrint> prep_frame_view_;
scoped_ptr<PreviewMetafile> metafile_;
- // Total page count in the renderer.
- int total_page_count_;
-
// The current page to render.
int current_page_index_;

Powered by Google App Engine
This is Rietveld 408576698