Chromium Code Reviews| Index: chrome/browser/ui/webui/print_preview_handler.cc |
| diff --git a/chrome/browser/ui/webui/print_preview_handler.cc b/chrome/browser/ui/webui/print_preview_handler.cc |
| index aff52a54bf386e83837138abda7a394647e98c50..bd281a0f3d199598edc9dd099423dc390b7c59b4 100644 |
| --- a/chrome/browser/ui/webui/print_preview_handler.cc |
| +++ b/chrome/browser/ui/webui/print_preview_handler.cc |
| @@ -552,13 +552,10 @@ void PrintPreviewHandler::HandleShowSystemDialog(const ListValue* args) { |
| TabContents* initiator_tab = GetInitiatorTab(); |
| if (!initiator_tab) |
| return; |
| - initiator_tab->Activate(); |
| TabContentsWrapper* wrapper = |
| TabContentsWrapper::GetCurrentWrapperForContents(initiator_tab); |
| - wrapper->print_view_manager()->PrintNow(); |
| - |
| - ClosePrintPreviewTab(); |
| + wrapper->print_view_manager()->PrintNow(this); |
| } |
| void PrintPreviewHandler::HandleManagePrinters(const ListValue* args) { |
| @@ -631,6 +628,15 @@ void PrintPreviewHandler::ClosePrintPreviewTab() { |
| &preview_tab()->controller()), TabStripModel::CLOSE_NONE); |
| } |
| +void PrintPreviewHandler::OnPrintDialogShown() { |
| + TabContents* initiator_tab = GetInitiatorTab(); |
| + if (!initiator_tab) |
|
Lei Zhang
2011/06/21 01:54:46
FWIW, I don't think is can happen.
James Hawkins
2011/06/22 23:47:24
It can (just tested).
Lei Zhang
2011/06/23 17:08:45
How?
James Hawkins
2011/06/27 21:58:17
Just tested again and it's now not possible, thoug
|
| + return; |
| + |
| + initiator_tab->Activate(); |
| + ClosePrintPreviewTab(); |
| +} |
| + |
| void PrintPreviewHandler::SelectFile(const FilePath& default_filename) { |
| SelectFileDialog::FileTypeInfo file_type_info; |
| file_type_info.extensions.resize(1); |