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

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

Issue 2426503002: Make printing work better with OOPIF. (Closed)
Patch Set: Fix build, nits Created 4 years, 2 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/print_view_manager.h
diff --git a/chrome/browser/printing/print_view_manager.h b/chrome/browser/printing/print_view_manager.h
index b86c0b6474ed0b7d62f8a6b55bb374ffc22a86b3..dc4987c17b06621c0741db93aee7dab22cc62752 100644
--- a/chrome/browser/printing/print_view_manager.h
+++ b/chrome/browser/printing/print_view_manager.h
@@ -10,6 +10,7 @@
#include "content/public/browser/web_contents_user_data.h"
namespace content {
+class RenderFrameHost;
class RenderProcessHost;
}
@@ -30,14 +31,14 @@ class PrintViewManager : public PrintViewManagerBase,
// Same as PrintNow(), but for the case where a user press "ctrl+shift+p" to
// show the native system dialog. This can happen from both initiator and
// preview dialog.
- bool BasicPrint();
+ bool BasicPrint(content::RenderFrameHost* rfh);
#endif // ENABLE_BASIC_PRINTING
// Initiate print preview of the current document by first notifying the
// renderer. Since this happens asynchronous, the print preview dialog
// creation will not be completed on the return of this function. Returns
// false if print preview is impossible at the moment.
- bool PrintPreviewNow(bool selection_only);
+ bool PrintPreviewNow(content::RenderFrameHost* rfh, bool has_selection);
// Notify PrintViewManager that print preview is starting in the renderer for
// a particular WebNode.
@@ -48,7 +49,8 @@ class PrintViewManager : public PrintViewManagerBase,
void PrintPreviewDone();
// content::WebContentsObserver implementation.
- bool OnMessageReceived(const IPC::Message& message) override;
+ bool OnMessageReceived(const IPC::Message& message,
+ content::RenderFrameHost* render_frame_host) override;
// content::WebContentsObserver implementation.
void RenderFrameCreated(content::RenderFrameHost* render_frame_host) override;
@@ -57,6 +59,8 @@ class PrintViewManager : public PrintViewManagerBase,
// Terminates or cancels the print job if one was pending.
void RenderProcessGone(base::TerminationStatus status) override;
+ content::RenderFrameHost* print_preview_rfh() { return print_preview_rfh_; }
+
private:
explicit PrintViewManager(content::WebContents* web_contents);
friend class content::WebContentsUserData<PrintViewManager>;
@@ -68,9 +72,10 @@ class PrintViewManager : public PrintViewManagerBase,
};
// IPC Message handlers.
- void OnDidShowPrintDialog();
+ void OnDidShowPrintDialog(content::RenderFrameHost* rfh);
void OnSetupScriptedPrintPreview(IPC::Message* reply_msg);
- void OnShowScriptedPrintPreview(bool source_is_modifiable);
+ void OnShowScriptedPrintPreview(content::RenderFrameHost* rfh,
+ bool source_is_modifiable);
void OnScriptedPrintPreviewReply(IPC::Message* reply_msg);
base::Closure on_print_dialog_shown_callback_;
@@ -78,6 +83,9 @@ class PrintViewManager : public PrintViewManagerBase,
// Current state of print preview for this view.
PrintPreviewState print_preview_state_;
+ content::RenderFrameHost* print_preview_rfh_;
+ content::RenderFrameHost* scripted_print_rfh_;
nasko 2016/11/02 04:50:37 Can you put comments on what each of these is used
Lei Zhang 2016/11/08 11:13:22 Done.
+
// Keeps track of the pending callback during scripted print preview.
content::RenderProcessHost* scripted_print_preview_rph_;

Powered by Google App Engine
This is Rietveld 408576698