Chromium Code Reviews| Index: chrome/browser/printing/print_preview_tab_controller.cc |
| diff --git a/chrome/browser/printing/print_preview_tab_controller.cc b/chrome/browser/printing/print_preview_tab_controller.cc |
| index 365f51e6ccd3a45a9295dda2cf94674b050f6690..25cfef493d1ec64e83512f1229f07e64d16dd632 100644 |
| --- a/chrome/browser/printing/print_preview_tab_controller.cc |
| +++ b/chrome/browser/printing/print_preview_tab_controller.cc |
| @@ -10,6 +10,7 @@ |
| #include "base/utf_string_conversions.h" |
| #include "chrome/browser/browser_process.h" |
| #include "chrome/browser/profiles/profile.h" |
| +#include "chrome/browser/printing/background_printing_manager.h" |
| #include "chrome/browser/sessions/restore_tab_helper.h" |
| #include "chrome/browser/tabs/tab_strip_model.h" |
| #include "chrome/browser/ui/browser.h" |
| @@ -174,8 +175,13 @@ void PrintPreviewTabController::OnTabContentsDestroyed(TabContents* tab) { |
| if (tab == preview_tab) { |
| // Remove the initiator tab's observers before erasing the mapping. |
| TabContents* initiator_tab = GetInitiatorTab(tab); |
| - if (initiator_tab) |
| + if (initiator_tab) { |
| RemoveObservers(initiator_tab); |
| + TabContentsWrapper* initiator_wrapper = |
| + TabContentsWrapper::GetCurrentWrapperForContents(initiator_tab); |
| + g_browser_process->background_printing_manager()-> |
| + ReleaseInitiatorTabContents(initiator_wrapper); |
|
kmadhusu
2011/08/18 23:45:50
You need to delete the initiator tab request after
Sheridan Rawlins
2011/08/19 00:24:25
Done.
|
| + } |
| // Print preview tab contents are destroyed. Notify |PrintPreviewUI| to |
| // abort the initiator tab preview request. |
| @@ -248,8 +254,13 @@ void PrintPreviewTabController::OnNavEntryCommitted( |
| if (source_tab_is_preview_tab) { |
| // Remove the initiator tab's observers before erasing the mapping. |
| TabContents* initiator_tab = GetInitiatorTab(tab); |
| - if (initiator_tab) |
| + if (initiator_tab) { |
| RemoveObservers(initiator_tab); |
| + TabContentsWrapper* initiator_wrapper = |
| + TabContentsWrapper::GetCurrentWrapperForContents(initiator_tab); |
| + g_browser_process->background_printing_manager()-> |
| + ReleaseInitiatorTabContents(initiator_wrapper); |
| + } |
| preview_tab_map_.erase(tab); |
| } else { |
| preview_tab_map_[preview_tab] = NULL; |