Index: chrome/browser/printing/printing_message_filter.h |
diff --git a/chrome/browser/printing/printing_message_filter.h b/chrome/browser/printing/printing_message_filter.h |
index 6e1ea108b8413f7b7169bf460172d7b91e9c261f..b0fb464a74695b5db3c9a330142ac8c7424ad5b3 100644 |
--- a/chrome/browser/printing/printing_message_filter.h |
+++ b/chrome/browser/printing/printing_message_filter.h |
@@ -9,7 +9,9 @@ |
#include <string> |
#include "base/compiler_specific.h" |
+#include "chrome/browser/printing/printer_query.h" |
#include "content/public/browser/browser_message_filter.h" |
+#include "content/public/browser/web_contents.h" |
Lei Zhang
2012/06/11 23:32:28
Forward declare.
Albert Bodenhamer
2012/06/12 01:19:02
Done.
|
#if defined(OS_WIN) |
#include "base/shared_memory.h" |
@@ -22,7 +24,6 @@ class DictionaryValue; |
} |
namespace printing { |
-class PrinterQuery; |
class PrintJobManager; |
} |
@@ -56,8 +57,30 @@ class PrintingMessageFilter : public content::BrowserMessageFilter { |
void OnTempFileForPrintingWritten(int render_view_id, int sequence_number); |
#endif |
- // Get the default print setting. The task is handled by the print |
- // worker thread and the UI thread. The reply occurs on the IO thread. |
+ // Given a render_view_id get the corresponding WebContents. |
+ // Must be called on the UI thread. |
+ content::WebContents* GetWebContentsForRenderView(int render_view_id); |
+ |
+ // GetPrintSettingsForRenderView must be called via PostTask and |
+ // base::Bind. Collapse the settings-specific params into a |
+ // struct to avoid running into issues with too many params |
+ // to base::Bind. |
+ struct GetPrintSettingsForRenderViewParams { |
Lei Zhang
2012/06/11 23:32:28
I think you can just forward declare this here and
Albert Bodenhamer
2012/06/12 01:19:02
Done.
|
+ printing::PrinterQuery::GetSettingsAskParam ask_user_for_settings; |
+ int expected_page_count; |
+ bool has_selection; |
+ printing::MarginType margin_type; |
+ }; |
+ |
+ // Retrieve print settings. Uses |render_view_id| to get a parent |
+ // for any UI created if needed. |
+ void GetPrintSettingsForRenderView( |
+ int render_view_id, |
+ GetPrintSettingsForRenderViewParams params, |
+ const base::Closure& callback, |
+ scoped_refptr<printing::PrinterQuery> printer_query); |
+ |
+ // Get the default print setting. |
void OnGetDefaultPrintSettings(IPC::Message* reply_msg); |
void OnGetDefaultPrintSettingsReply( |
scoped_refptr<printing::PrinterQuery> printer_query, |