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

Side by Side Diff: chrome/renderer/print_web_view_helper.cc

Issue 7202012: Print Preview: Display a throbber when the user requests the system print (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fixes. Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/print_web_view_helper.h" 5 #include "chrome/renderer/print_web_view_helper.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 params.routing_id = render_view()->routing_id(); 626 params.routing_id = render_view()->routing_id();
627 // host_window_ may be NULL at this point if the current window is a 627 // host_window_ may be NULL at this point if the current window is a
628 // popup and the print() command has been issued from the parent. The 628 // popup and the print() command has been issued from the parent. The
629 // receiver of this message has to deal with this. 629 // receiver of this message has to deal with this.
630 params.host_window_id = render_view()->host_window(); 630 params.host_window_id = render_view()->host_window();
631 params.cookie = print_pages_params_->params.document_cookie; 631 params.cookie = print_pages_params_->params.document_cookie;
632 params.has_selection = frame->hasSelection(); 632 params.has_selection = frame->hasSelection();
633 params.expected_pages_count = expected_pages_count; 633 params.expected_pages_count = expected_pages_count;
634 params.use_overlays = use_browser_overlays; 634 params.use_overlays = use_browser_overlays;
635 635
636 Send(new PrintHostMsg_DidShowPrintDialog(routing_id()));
637
636 print_pages_params_.reset(); 638 print_pages_params_.reset();
637 IPC::SyncMessage* msg = 639 IPC::SyncMessage* msg =
638 new PrintHostMsg_ScriptedPrint(routing_id(), params, &print_settings); 640 new PrintHostMsg_ScriptedPrint(routing_id(), params, &print_settings);
639 msg->EnableMessagePumping(); 641 msg->EnableMessagePumping();
640 Send(msg); 642 Send(msg);
641 print_pages_params_.reset(new PrintMsg_PrintPages_Params(print_settings)); 643 print_pages_params_.reset(new PrintMsg_PrintPages_Params(print_settings));
642 return (print_settings.params.dpi && print_settings.params.document_cookie); 644 return (print_settings.params.dpi && print_settings.params.document_cookie);
643 } 645 }
644 646
645 bool PrintWebViewHelper::RenderPagesForPrint(WebKit::WebFrame* frame, 647 bool PrintWebViewHelper::RenderPagesForPrint(WebKit::WebFrame* frame,
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 757
756 void PrintWebViewHelper::DisplayPrintJobError() { 758 void PrintWebViewHelper::DisplayPrintJobError() {
757 WebView* web_view = print_web_view_; 759 WebView* web_view = print_web_view_;
758 if (!web_view) 760 if (!web_view)
759 web_view = render_view()->webview(); 761 web_view = render_view()->webview();
760 762
761 render_view()->runModalAlertDialog( 763 render_view()->runModalAlertDialog(
762 web_view->mainFrame(), 764 web_view->mainFrame(),
763 l10n_util::GetStringUTF16(IDS_PRINT_SPOOL_FAILED_ERROR_TEXT)); 765 l10n_util::GetStringUTF16(IDS_PRINT_SPOOL_FAILED_ERROR_TEXT));
764 } 766 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698