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..00094c2cc2429af724a57fce616d3a0475db7d3e 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 |
|
sky
2012/09/19 17:06:59
Write a test for this.
simonhong_
2012/09/20 10:26:29
This can be verified by OomProirotyManager::Discar
sky
2012/09/20 15:24:08
Can't you call what OOMPriorityManager is invoking
simonhong_
2012/09/20 16:07:59
Modified tab_strip_model_unittest.
And Added some
|
| + // the last tab. After discarding last tab, it is reloaded again. So, do not |
| + // mark the tab. It is active tab. |
| + if (!IsTabSelected(index)) { |
| + // 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 |