diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-10 03:16:02 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-10 03:16:02 +0000 |
commit | 5bb3482de944f37ef43d2c9c391869f3b26b7480 (patch) | |
tree | 44e900ba99e4f55e09116644ecc4992cc860d9d2 /chrome/browser/printing/print_view_manager.cc | |
parent | 46d54c478142e7aca9b5f78e7fe46f5c28fcad6e (diff) | |
download | chromium_src-5bb3482de944f37ef43d2c9c391869f3b26b7480.zip chromium_src-5bb3482de944f37ef43d2c9c391869f3b26b7480.tar.gz chromium_src-5bb3482de944f37ef43d2c9c391869f3b26b7480.tar.bz2 |
Print Preview: Do not change the print preview state when print preview is not possible. Do reset the print preview state when the renderer goes away.
BUG=none
TEST=In a debug build, (1) open a tab, print preview, kill the tab from the task manager, and try to print preview again. (2) Trigger a bug that kills the initiator renderer right after it starts the print preview, and try to print preview again. Both of these cases should not crash.
Review URL: http://codereview.chromium.org/9371030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121395 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/printing/print_view_manager.cc')
-rw-r--r-- | chrome/browser/printing/print_view_manager.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/chrome/browser/printing/print_view_manager.cc b/chrome/browser/printing/print_view_manager.cc index c9c4f25..3a5bdd6 100644 --- a/chrome/browser/printing/print_view_manager.cc +++ b/chrome/browser/printing/print_view_manager.cc @@ -118,8 +118,11 @@ bool PrintViewManager::PrintPreviewNow() { NOTREACHED(); return false; } + if (!PrintNowInternal(new PrintMsg_InitiatePrintPreview(routing_id()))) + return false; + print_preview_state_ = USER_INITIATED_PREVIEW; - return PrintNowInternal(new PrintMsg_InitiatePrintPreview(routing_id())); + return true; } void PrintViewManager::PrintPreviewForWebNode() { @@ -162,6 +165,8 @@ void PrintViewManager::StopNavigation() { } void PrintViewManager::RenderViewGone(base::TerminationStatus status) { + print_preview_state_ = NOT_PREVIEWING; + if (!print_job_.get()) return; |