From 0c22345d5e500ad60e51b7a4c4da29fe3cf6ff64 Mon Sep 17 00:00:00 2001 From: "maruel@chromium.org" Date: Wed, 26 Aug 2009 00:10:02 +0000 Subject: Add a comment in PrintWebViewHelper::Print(). The use of DidFinishPrinting(user_cancelled_print) at the end of PrintWebViewHelper::Print() is confusing without a comment. TEST=none BUG=none Review URL: http://codereview.chromium.org/173368 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24376 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/renderer/print_web_view_helper_win.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'chrome/renderer/print_web_view_helper_win.cc') diff --git a/chrome/renderer/print_web_view_helper_win.cc b/chrome/renderer/print_web_view_helper_win.cc index fe7a8db..625a66d 100644 --- a/chrome/renderer/print_web_view_helper_win.cc +++ b/chrome/renderer/print_web_view_helper_win.cc @@ -139,6 +139,13 @@ void PrintWebViewHelper::Print(WebFrame* frame, bool script_initiated) { ++user_cancelled_scripted_print_count_; last_cancelled_script_print_ = base::Time::Now(); } + // When |user_cancelled_print| is true, we treat it as success so that + // DidFinishPrinting() won't show any error alert. + // If |user_cancelled_print| is false and we reach here, there must be + // something wrong and hence is not success, DidFinishPrinting() should show + // an error alert. + // In both cases, we have to call DidFinishPrinting() here to release + // printing resources, since we do need them anymore. DidFinishPrinting(user_cancelled_print); } -- cgit v1.1