| Index: chrome/browser/ui/browser.cc
|
| diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
|
| index 66990b19eabdc543c08b2798849d14e905f76b8a..64aa7d1108b3efe6c1d5ca696a5531f142595ae5 100644
|
| --- a/chrome/browser/ui/browser.cc
|
| +++ b/chrome/browser/ui/browser.cc
|
| @@ -60,6 +60,7 @@
|
| #include "chrome/browser/platform_util.h"
|
| #include "chrome/browser/prefs/incognito_mode_prefs.h"
|
| #include "chrome/browser/prefs/pref_service.h"
|
| +#include "chrome/browser/printing/background_printing_manager.h"
|
| #include "chrome/browser/printing/cloud_print/cloud_print_setup_flow.h"
|
| #include "chrome/browser/printing/print_preview_tab_controller.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| @@ -3405,6 +3406,19 @@ void Browser::CloseContents(TabContents* source) {
|
| return;
|
| }
|
|
|
| + // Various sites have a pattern which open a new window with output formatted
|
| + // for printing, then include a print button, which does window.print();
|
| + // window.close(); An example is printing Virgin America boarding
|
| + // pass. Instead of closing, when a print tab is associated with this tab,
|
| + // tell the BackgroundPrintingManager to own it, which causes it to be
|
| + // hidden and eventually closed when the print window is closed.
|
| + TabContentsWrapper* tab_wrapper =
|
| + TabContentsWrapper::GetCurrentWrapperForContents(source);
|
| + if (g_browser_process->background_printing_manager()->
|
| + OwnInitiatorTabContents(tab_wrapper)) {
|
| + return;
|
| + }
|
| +
|
| int index = tab_handler_->GetTabStripModel()->GetWrapperIndex(source);
|
| if (index == TabStripModel::kNoTab) {
|
| NOTREACHED() << "CloseContents called for tab not in our strip";
|
|
|