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..76bfbda1966abeb04030286b73c318552e273739 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" |
| @@ -185,6 +186,13 @@ void PrintPreviewTabController::OnTabContentsDestroyed(TabContents* tab) { |
| print_preview_ui->OnTabDestroyed(); |
| } |
| + // Release the initiator tab contents now, possibly deleting if owned. |
| + if (initiator_tab) { |
| + TabContentsWrapper* initiator_wrapper = |
|
kmadhusu
2011/08/19 17:13:04
You can move line #179 to here.
Sheridan Rawlins
2011/08/25 22:52:55
Done.
|
| + TabContentsWrapper::GetCurrentWrapperForContents(initiator_tab); |
| + g_browser_process->background_printing_manager()-> |
| + ReleaseInitiatorTabContents(initiator_wrapper); |
| + } |
| // Erase the map entry. |
| preview_tab_map_.erase(tab); |
| } else { |
| @@ -248,8 +256,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; |