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

Unified Diff: chrome/renderer/render_view.cc

Issue 125082: Add Print Selection support to Chrome. This change is fairly involved since ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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
« no previous file with comments | « chrome/renderer/render_view.h ('k') | webkit/glue/webview_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_view.cc
===================================================================
--- chrome/renderer/render_view.cc (revision 18804)
+++ chrome/renderer/render_view.cc (working copy)
@@ -339,6 +339,7 @@
IPC_BEGIN_MESSAGE_MAP(RenderView, message)
IPC_MESSAGE_HANDLER(ViewMsg_CaptureThumbnail, SendThumbnail)
IPC_MESSAGE_HANDLER(ViewMsg_PrintPages, OnPrintPages)
+ IPC_MESSAGE_HANDLER(ViewMsg_PrintingDone, OnPrintingDone)
IPC_MESSAGE_HANDLER(ViewMsg_Navigate, OnNavigate)
IPC_MESSAGE_HANDLER(ViewMsg_Stop, OnStop)
IPC_MESSAGE_HANDLER(ViewMsg_LoadAlternateHTMLText, OnLoadAlternateHTMLText)
@@ -454,6 +455,15 @@
}
}
+void RenderView::OnPrintingDone(int document_cookie, bool success) {
+ // Ignoring document cookie here since only one print job can be outstanding
+ // per renderer and document_cookie is 0 when printing is successful.
+ DCHECK(print_helper_.get());
+ if (print_helper_.get() != NULL) {
+ print_helper_->DidFinishPrinting(success);
+ }
+}
+
void RenderView::CapturePageInfo(int load_id, bool preliminary_capture) {
if (load_id != page_id_)
return; // this capture call is no longer relevant due to navigation
@@ -2217,9 +2227,10 @@
}
void RenderView::ScriptedPrint(WebFrame* frame) {
- print_render_view_.reset(new PrintWebViewHelper(this));
- print_render_view_->SyncPrint(frame);
- print_render_view_.reset();
+ if (print_helper_.get() == NULL) {
+ print_helper_.reset(new PrintWebViewHelper(this));
+ }
+ print_helper_->SyncPrint(frame);
}
void RenderView::WebInspectorOpened(int num_resources) {
« no previous file with comments | « chrome/renderer/render_view.h ('k') | webkit/glue/webview_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698