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

Unified Diff: chrome/browser/printing/printing_message_filter.h

Issue 10544084: Fix crash when displaying system print dialog on Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove extra render_view_id references Created 8 years, 6 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/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,
« no previous file with comments | « no previous file | chrome/browser/printing/printing_message_filter.cc » ('j') | chrome/browser/printing/printing_message_filter.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698