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 dfe3e92e57a0d17c7c1b9bf92321819370482b80..1eb30b56c267582446b4995cd713b7eea86c4d46 100644 |
--- a/chrome/renderer/print_web_view_helper.h |
+++ b/chrome/renderer/print_web_view_helper.h |
@@ -15,6 +15,8 @@ |
#include "third_party/WebKit/Source/WebKit/chromium/public/WebViewClient.h" |
#include "ui/gfx/size.h" |
+class DictionaryValue; |
+ |
namespace gfx { |
class Size; |
} |
@@ -85,7 +87,7 @@ class PrintWebViewHelper : public RenderViewObserver , |
// Message handlers. Public for testing. |
void OnPrintingDone(int document_cookie, bool success); |
- void OnPrintForPrintPreview(); |
+ void OnPrintForPrintPreview(const DictionaryValue& job_settings); |
void OnPrintPages(); |
void OnPrintPreview(); |
void OnPrintNodeUnderContextMenu(); |
@@ -116,6 +118,11 @@ class PrintWebViewHelper : public RenderViewObserver , |
virtual void didStopLoading(); |
private: |
+ enum GetSettingsParam { |
+ DEFAULT, |
+ CURRENT, |
+ }; |
+ |
static void GetPageSizeAndMarginsInPoints( |
WebKit::WebFrame* frame, |
int page_index, |
@@ -140,6 +147,11 @@ class PrintWebViewHelper : public RenderViewObserver , |
// 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, |
@@ -151,12 +163,20 @@ class PrintWebViewHelper : public RenderViewObserver , |
// Initialize print page settings with default settings. |
Lei Zhang
2011/03/02 23:28:54
This comment needs to be updated.
kmadhusu
2011/03/04 19:39:02
I reverted my changes to this function. So I didn'
|
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| |
+ // dictionary contains print job details such as printer name, number of |
+ // copies, page range, etc. |
+ bool UpdatePrintSettings(const DictionaryValue& 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. |