Commit 98495213 authored by Mei Liang's avatar Mei Liang Committed by Commit Bot

Avoid MobileTabSwitched.GridTabSwitcher being logged on tab creation

This CL also avoids MobileTabReturnedToCurrentTab being logged twice
when using back button to leave GTS.

Bug: 1025111, 1119414
Change-Id: Ie0839f27481b9b6033e4f8547ec85f7790207a2d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2366032Reviewed-by: default avatarWei-Yin Chen (陳威尹) <wychen@chromium.org>
Commit-Queue: Mei Liang <meiliang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800306}
parent 4a17e8d6
......@@ -489,10 +489,9 @@ class TabSwitcherMediator implements TabSwitcher.Controller, TabListRecyclerView
.getCurrentTabModelFilter()
.indexOf(tab);
if (fromIndex != toIndex || fromTab.getId() == tab.getId()) {
if (fromIndex != toIndex) {
// Only log when you switch a tab page directly from tab switcher.
if (!TabUiFeatureUtilities.isTabGroupsAndroidEnabled()
|| getRelatedTabs(tab.getId()).size() == 1) {
if (getRelatedTabs(tab.getId()).size() == 1) {
RecordUserAction.record(
"MobileTabSwitched." + TabSwitcherCoordinator.COMPONENT_NAME);
}
......@@ -679,8 +678,6 @@ class TabSwitcherMediator implements TabSwitcher.Controller, TabListRecyclerView
}
if (mTabModelSelector.getCurrentTab() == null) return false;
recordUserSwitchedTab(
mTabModelSelector.getCurrentTab(), mTabModelSelector.getCurrentTabId());
onTabSelecting(mTabModelSelector.getCurrentTabId());
return true;
......
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