Commit 5d1d9ea3 authored by Mei Liang's avatar Mei Liang Committed by Commit Bot

[TabGroup] Only select tab when TabModel's index is valid

Change-Id: I1f47ae01c8bcde3693373538e050e8de4c3fcb4e
Bug: 985879
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1747379
Commit-Queue: Mei Liang <meiliang@chromium.org>
Reviewed-by: default avatarWei-Yin Chen (陳威尹) <wychen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688638}
parent e08a5fb0
...@@ -558,7 +558,11 @@ public class TabGroupModelFilter extends TabModelFilter { ...@@ -558,7 +558,11 @@ public class TabGroupModelFilter extends TabModelFilter {
reorderGroup(TabGroup.INVALID_GROUP_ID); reorderGroup(TabGroup.INVALID_GROUP_ID);
TabModel tabModel = getTabModel(); TabModel tabModel = getTabModel();
selectTab(tabModel.getTabAt(tabModel.index())); if (tabModel.index() == TabModel.INVALID_TAB_INDEX) {
mCurrentGroupIndex = TabModel.INVALID_TAB_INDEX;
} else {
selectTab(tabModel.getTabAt(tabModel.index()));
}
assert mGroupIdToGroupIndexMap.size() == mGroupIdToGroupMap.size(); assert mGroupIdToGroupIndexMap.size() == mGroupIdToGroupMap.size();
} }
...@@ -601,7 +605,11 @@ public class TabGroupModelFilter extends TabModelFilter { ...@@ -601,7 +605,11 @@ public class TabGroupModelFilter extends TabModelFilter {
super.resetFilterState(); super.resetFilterState();
TabModel tabModel = getTabModel(); TabModel tabModel = getTabModel();
selectTab(tabModel.getTabAt(tabModel.index())); if (tabModel.index() == TabModel.INVALID_TAB_INDEX) {
mCurrentGroupIndex = TabModel.INVALID_TAB_INDEX;
} else {
selectTab(tabModel.getTabAt(tabModel.index()));
}
mShouldRecordUma = true; mShouldRecordUma = true;
mIsResetting = false; mIsResetting = false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment