Chromium Code Reviews| Index: chrome/browser/ui/webui/print_preview_handler.cc |
| =================================================================== |
| --- chrome/browser/ui/webui/print_preview_handler.cc (revision 97484) |
| +++ chrome/browser/ui/webui/print_preview_handler.cc (working copy) |
| @@ -477,13 +477,18 @@ |
| scoped_ptr<DictionaryValue> settings(GetSettingsDictionary(args)); |
| if (!settings.get()) |
| return; |
| + int request_id = -1; |
| + if (!settings->GetInteger(printing::kPreviewRequestID, &request_id)) |
| + return; |
| + PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>(web_ui_); |
| + print_preview_ui->OnPrintPreviewRequest(request_id); |
|
kmadhusu
2011/08/19 19:51:03
how about OnPrintPreviewRequest => UpdatePreviewRe
Lei Zhang
2011/08/19 22:50:28
Most of the print preview UI methods are in the fo
|
| + settings->SetString(printing::kPreviewUIAddr, |
|
kmadhusu
2011/08/19 19:51:03
Add a comment on why you are adding this UI addres
Lei Zhang
2011/08/19 22:50:28
Done.
|
| + print_preview_ui->GetPrintPreviewUIAddress()); |
| + |
| // Increment request count. |
| ++regenerate_preview_request_count_; |
| - PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>(web_ui_); |
| - print_preview_ui->OnPrintPreviewRequest(); |
| - |
| TabContents* initiator_tab = GetInitiatorTab(); |
| if (!initiator_tab) { |
| if (!reported_failed_preview_) { |
| @@ -874,11 +879,6 @@ |
| TabContentsWrapper* wrapper = |
| TabContentsWrapper::GetCurrentWrapperForContents(initiator_tab); |
| wrapper->print_view_manager()->set_observer(NULL); |
|
kmadhusu
2011/08/19 19:51:03
Do you still need "OnTabDestroyed" function? Initi
Lei Zhang
2011/08/19 22:50:28
I believe it's still needed for http://crbug.com/8
|
| - |
| - // Tell the initiator tab to stop rendering the print preview, if any, |
| - // since the preview tab is gone. |
| - RenderViewHost* rvh = initiator_tab->render_view_host(); |
| - rvh->Send(new PrintMsg_AbortPreview(rvh->routing_id())); |
| } |
| void PrintPreviewHandler::FileSelected(const FilePath& path, |