| Index: chrome/browser/ui/browser.cc
|
| diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
|
| index 1b5e6971449e871278e51567b65840270c236318..94037f2108fccf83730efa6831e9c7b56dd7ed58 100644
|
| --- a/chrome/browser/ui/browser.cc
|
| +++ b/chrome/browser/ui/browser.cc
|
| @@ -1304,9 +1304,15 @@ void Browser::ShowDownload(content::DownloadItem* download) {
|
|
|
| // If the download occurs in a new tab, and it's not a save page
|
| // download (started before initial navigation completed) close it.
|
| + // Avoid calling CloseContents if the tab is not in this browser's tab strip
|
| + // model; this can happen if the download was initiated by something internal
|
| + // to Chrome, such as by the app list.
|
| WebContents* source = download->GetWebContents();
|
| if (source && source->GetController().IsInitialNavigation() &&
|
| - tab_strip_model_->count() > 1 && !download->IsSavePackageDownload()) {
|
| + tab_strip_model_->count() > 1 &&
|
| + tab_strip_model_->GetIndexOfWebContents(source) !=
|
| + TabStripModel::kNoTab &&
|
| + !download->IsSavePackageDownload()) {
|
| CloseContents(source);
|
| }
|
|
|
|
|