| Index: chrome/browser/tabs/tab_strip_model_order_controller.cc
|
| diff --git a/chrome/browser/tabs/tab_strip_model_order_controller.cc b/chrome/browser/tabs/tab_strip_model_order_controller.cc
|
| index a967bd9ba829fa824e1240881f8632cf48348fe3..f7742085ab95c0289a615b7d2184de49de511a73 100644
|
| --- a/chrome/browser/tabs/tab_strip_model_order_controller.cc
|
| +++ b/chrome/browser/tabs/tab_strip_model_order_controller.cc
|
| @@ -64,8 +64,7 @@ int TabStripModelOrderController::DetermineInsertionIndexForAppending() {
|
| }
|
|
|
| int TabStripModelOrderController::DetermineNewSelectedIndex(
|
| - int removing_index,
|
| - bool is_remove) const {
|
| + int removing_index) const {
|
| int tab_count = tabstrip_->count();
|
| DCHECK(removing_index >= 0 && removing_index < tab_count);
|
| NavigationController* parent_opener =
|
| @@ -79,7 +78,7 @@ int TabStripModelOrderController::DetermineNewSelectedIndex(
|
| removing_index,
|
| false);
|
| if (index != TabStripModel::kNoTab)
|
| - return GetValidIndex(index, removing_index, is_remove);
|
| + return GetValidIndex(index, removing_index);
|
|
|
| if (parent_opener) {
|
| // If the tab was in a group, shift selection to the next tab in the group.
|
| @@ -87,19 +86,19 @@ int TabStripModelOrderController::DetermineNewSelectedIndex(
|
| removing_index,
|
| false);
|
| if (index != TabStripModel::kNoTab)
|
| - return GetValidIndex(index, removing_index, is_remove);
|
| + return GetValidIndex(index, removing_index);
|
|
|
| // If we can't find a subsequent group member, just fall back to the
|
| // parent_opener itself. Note that we use "group" here since opener is
|
| // reset by select operations..
|
| index = tabstrip_->GetIndexOfController(parent_opener);
|
| if (index != TabStripModel::kNoTab)
|
| - return GetValidIndex(index, removing_index, is_remove);
|
| + return GetValidIndex(index, removing_index);
|
| }
|
|
|
| // No opener set, fall through to the default handler...
|
| int selected_index = tabstrip_->selected_index();
|
| - if (is_remove && selected_index >= (tab_count - 1))
|
| + if (selected_index >= (tab_count - 1))
|
| return selected_index - 1;
|
| return selected_index;
|
| }
|
| @@ -133,9 +132,6 @@ void TabStripModelOrderController::TabSelectedAt(TabContents* old_contents,
|
| // TabStripModelOrderController, private:
|
|
|
| int TabStripModelOrderController::GetValidIndex(int index,
|
| - int removing_index,
|
| - bool is_remove) const {
|
| - if (is_remove && removing_index < index)
|
| - index = std::max(0, index - 1);
|
| - return index;
|
| + int removing_index) const {
|
| + return removing_index < index ? std::max(0, index - 1) : index;
|
| }
|
|
|