Chromium Code Reviews| Index: chrome/renderer/print_web_view_helper.h |
| diff --git a/chrome/renderer/print_web_view_helper.h b/chrome/renderer/print_web_view_helper.h |
| index d08e39232488df495c066b7563aedd3480956cb5..1953909587d595b299d16d25445466f7b36703b7 100644 |
| --- a/chrome/renderer/print_web_view_helper.h |
| +++ b/chrome/renderer/print_web_view_helper.h |
| @@ -89,7 +89,7 @@ class PrintWebViewHelper : public RenderViewObserver , |
| // Message handlers. Public for testing. |
| void OnPrintingDone(int document_cookie, bool success); |
| - void OnPrintForPrintPreview(); |
| + void OnPrintForPrintPreview(const std::string& job_settings); |
| void OnPrintPages(); |
| void OnPrintPreview(); |
| void OnPrintNodeUnderContextMenu(); |
| @@ -120,6 +120,11 @@ class PrintWebViewHelper : public RenderViewObserver , |
| virtual void didStopLoading(); |
| private: |
| + enum GetSettingsParam { |
| + DEFAULT, |
|
Lei Zhang
2011/02/18 05:21:42
Do you intend to have more types in this enum? If
kmadhusu
2011/02/21 01:30:26
Just for readability and better understanding of t
|
| + CURRENT, |
| + }; |
| + |
| static void GetPageSizeAndMarginsInPoints( |
| WebKit::WebFrame* frame, |
| int page_index, |
| @@ -139,11 +144,17 @@ class PrintWebViewHelper : public RenderViewObserver , |
| void PrintNode(WebKit::WebNode* node, |
| bool script_initiated, |
| - bool is_preview); |
| + bool is_preview, |
| + bool is_print_for_print_preview); |
| // Notification when printing is done - signal teardown |
| void DidFinishPrinting(bool success); |
| + // Print the pages for print preview. Do not display the native print dialog |
| + // for user settings. Use the current print settings set by the user in |
| + // preview tab. |
| + void PrintForPrintPreview(WebKit::WebFrame* frame, WebKit::WebNode* node); |
| + |
| void Print(WebKit::WebFrame* frame, |
| WebKit::WebNode* node, |
| bool script_initiated, |
| @@ -155,12 +166,20 @@ class PrintWebViewHelper : public RenderViewObserver , |
| // Initialize print page settings with default settings. |
| bool InitPrintSettings(WebKit::WebFrame* frame, |
| - WebKit::WebNode* node); |
| - |
| - // Get the default printer settings. |
| - bool GetDefaultPrintSettings(WebKit::WebFrame* frame, |
| - WebKit::WebNode* node, |
| - ViewMsg_Print_Params* params); |
| + WebKit::WebNode* node, |
| + GetSettingsParam setting_type); |
| + |
| + // Update the current print settings with new |job_settings|. |job_settings| |
| + // is a json string which contains print job details such as printer name, |
| + // number of copies, page range, etc. |
| + bool UpdatePrintSettings(const std::string& job_settings); |
| + |
| + // Get the print settings. |setting_type| determines whether we need to get |
| + // current settings or default settings. |
| + bool GetPrintSettings(WebKit::WebFrame* frame, |
| + WebKit::WebNode* node, |
| + GetSettingsParam setting_type, |
| + ViewMsg_Print_Params* params); |
| // Get final print settings from the user. |
| // Return false if the user cancels or on error. |