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

Unified Diff: chrome/renderer/print_web_view_helper.h

Issue 7747033: Merge 97702, 97820, 97976 (Closed) Base URL: svn://chrome-svn/chrome/branches/835/src/
Patch Set: Created 9 years, 4 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
« no previous file with comments | « chrome/renderer/mock_render_thread.cc ('k') | chrome/renderer/print_web_view_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/print_web_view_helper.h
===================================================================
--- chrome/renderer/print_web_view_helper.h (revision 98330)
+++ chrome/renderer/print_web_view_helper.h (working copy)
@@ -135,19 +135,13 @@
// Initialize the print preview document.
bool CreatePreviewDocument();
- // Continue generating the print preview. |requested_preview_page_index|
- // specifies the browser requested preview page index. It is 1-based or
- // |printing::INVALID_PAGE_INDEX| to continue with next page.
- void OnContinuePreview(int requested_preview_page_index);
// Renders a print preview page. |page_number| is 0-based.
- void RenderPreviewPage(int page_number);
+ // Returns true if print preview should continue, false on failure.
+ bool RenderPreviewPage(int page_number);
+
// Finalize the print preview document.
bool FinalizePreviewDocument();
- // Abort the preview to put |print_preview_context_| into the 'UNINITIALIZED'
- // state.
- void OnAbortPreview();
-
// Print / preview the node under the context menu.
void OnPrintNodeUnderContextMenu();
@@ -165,7 +159,6 @@
OK,
FAIL_PRINT,
FAIL_PREVIEW,
- ABORT_PREVIEW,
};
// Notification when printing is done - signal tear-down/free resources.
@@ -184,15 +177,11 @@
WebKit::WebNode* node,
scoped_ptr<PrepareFrameAndViewForPrint>* prepare);
- // Parse the request id out of |job_settings| and store it in |params|.
- // Returns false on failure.
- bool UpdatePrintSettingsRequestId(const base::DictionaryValue& job_settings,
- PrintMsg_Print_Params* params);
-
// Update the current print settings with new |job_settings|. |job_settings|
// dictionary contains print job details such as printer name, number of
// copies, page range, etc.
- bool UpdatePrintSettings(const base::DictionaryValue& job_settings);
+ bool UpdatePrintSettings(const base::DictionaryValue& job_settings,
+ bool is_preview);
// Get final print settings from the user.
// Return false if the user cancels or on error.
@@ -283,11 +272,17 @@
void RequestPrintPreview();
- // Notify the browser a print preview page has been rendered.
- // |page_number| is 0-based or |printing::INVALID_PAGE_INDEX| to check
- // for pending preview requests.
- void PreviewPageRendered(int page_number, printing::Metafile* metafile);
+ // Checks whether print preview should continue or not.
+ // Returns true if cancelling, false if continuing.
+ bool CheckForCancel();
+ // Notifies the browser a print preview page has been rendered.
+ // |page_number| is 0-based.
+ // For a valid |page_number| with modifiable content,
+ // |metafile| is the rendered page. Otherwise |metafile| is NULL.
+ // Returns true if print preview should continue, false on failure.
+ bool PreviewPageRendered(int page_number, printing::Metafile* metafile);
+
WebKit::WebView* print_web_view_;
scoped_ptr<PrintMsg_PrintPages_Params> print_pages_params_;
@@ -334,13 +329,9 @@
// Cleanup after print preview fails.
void Failed();
- // Abort the print preview.
- void Abort();
-
// Helper functions
int GetNextPageNumber();
bool IsReadyToRender() const;
- bool IsBusy() const;
bool IsModifiable() const;
// Getters
@@ -377,12 +368,9 @@
int actual_page_count_;
// The current page to render.
- int current_page_number_;
+ int current_page_index_;
- // |rendered_pages_| tracks which pages need to be printed as well as
- // the page slot it should be printed in. See GetPageSlotForPage.
- typedef std::pair<bool, int> PreviewPageInfo;
- std::vector<PreviewPageInfo> rendered_pages_;
+ std::vector<int> pages_to_render_;
base::TimeDelta document_render_time_;
base::TimeTicks begin_time_;
« no previous file with comments | « chrome/renderer/mock_render_thread.cc ('k') | chrome/renderer/print_web_view_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698