Chromium Code Reviews| Index: chrome/browser/printing/print_preview_message_handler.cc |
| =================================================================== |
| --- chrome/browser/printing/print_preview_message_handler.cc (revision 105275) |
| +++ chrome/browser/printing/print_preview_message_handler.cc (working copy) |
| @@ -171,8 +171,6 @@ |
| return; |
| } |
| - print_preview_tab->print_view_manager()->OverrideTitle(tab_contents()); |
| - |
| // TODO(joth): This seems like a good match for using RefCountedStaticMemory |
| // to avoid the memory copy, but the SetPrintPreviewData call chain below |
| // needs updating to accept the RefCountedMemory* base class. |
| @@ -246,7 +244,32 @@ |
| if (tab_contents()->delegate() && |
| PrintPreviewTabController::IsPrintPreviewTab(tab_contents_wrapper())) { |
| tab_contents()->SetContentRestrictions(CONTENT_RESTRICTION_PRINT); |
| + |
| + // Need to get the initiator tab to enabled advanced printing. |
| + PrintPreviewTabController* tab_controller = |
| + PrintPreviewTabController::GetInstance(); |
| + if (tab_controller) { |
| + TabContentsWrapper* initiator_tab = |
| + tab_controller->GetInitiatorTab(tab_contents_wrapper()); |
|
kmadhusu
2011/10/13 18:52:18
Store the tab_contents_wrapper() in a local variab
Lei Zhang
2011/10/13 21:12:12
Done.
|
| + if (initiator_tab) { |
| + TabContents* contents = initiator_tab->tab_contents(); |
| + contents->SetContentRestrictions(contents->content_restrictions()); |
| + } |
| + } |
| } |
| } |
| +void PrintPreviewMessageHandler::NavigateToPendingEntry( |
| + const GURL& url, |
| + NavigationController::ReloadType reload_type) { |
|
kmadhusu
2011/10/13 18:52:18
Do you need to call StopWorker() here?
Lei Zhang
2011/10/13 21:12:12
I don't think so. Why do you say that?
|
| + TabContentsWrapper* tab = tab_contents_wrapper(); |
| + TabContentsWrapper* preview_tab = GetPrintPreviewTab(); |
| + if (tab == preview_tab) { |
| + NOTREACHED(); |
| + return; |
| + } |
| + if (preview_tab) |
| + tab->print_view_manager()->PrintPreviewDone(); |
| +} |
| + |
| } // namespace printing |