Chromium Code Reviews| Index: chrome/browser/ui/tabs/tab_strip_model.cc |
| diff --git a/chrome/browser/ui/tabs/tab_strip_model.cc b/chrome/browser/ui/tabs/tab_strip_model.cc |
| index c622f87da28b953a5db28644bbfea2f0403e8e31..875ad2cf2a77a2eb2ead0cb0d889dd5e99d87ac4 100644 |
| --- a/chrome/browser/ui/tabs/tab_strip_model.cc |
| +++ b/chrome/browser/ui/tabs/tab_strip_model.cc |
| @@ -217,8 +217,14 @@ TabContents* TabStripModel::DiscardTabContentsAt(int index) { |
| old_contents->web_contents()->GetController()); |
| // Replace the tab we're discarding with the null version. |
| ReplaceTabContentsAt(index, null_contents); |
| - // Mark the tab so it will reload when we click. |
| - contents_data_[index]->discarded = true; |
| + |
| + // Only mark tabs that are not selected. When selected tab is discarded, it is |
| + // the last tab. After discarding last tab, it is reloaded again. So, we |
| + // should not mark the tab. |
| + if (!IsTabSelected(index)) { |
|
sky
2012/09/20 19:31:09
I don't understand this. What is triggering the lo
simonhong_
2012/09/21 00:16:37
I'll explain problematic scenario according to thi
|
| + // Mark the tab so it will reload when we click. |
| + contents_data_[index]->discarded = true; |
| + } |
| // Discard the old tab's renderer. |
| // TODO(jamescook): This breaks script connections with other tabs. |
| // We need to find a different approach that doesn't do that, perhaps based |