New issue
Advanced search Search tips

Issue 837838 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Task



Sign in to add a comment

TabModelObserver#didSelectTab should only occur on tab selection

Project Member Reported by mdjones@chromium.org, Apr 27 2018

Issue description

TabModelObserver#didSelectTab is called in more cases than when a tab is selected, for example, when a tab is opened in the background on phones (but not tablet). There is logic where the event is called that suggests that this behavior is expected, but it shouldn't be:

https://codesearch.chromium.org/chromium/src/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelImpl.java?rcl=ca318fa07be3e48d5dc9a886608823a835585c69&l=490 

We should fix this so that the event is only called when a different tab is selected. This can probably be done as an ID equality check before the event is called.
 
Cc: tiborg@chromium.org
It also happens when closing the active tab. First, didSelectTab is called with TabSelectionType.FROM_CLOSE and the newly active tab. And then with TabSelectionType.FROM_USER and the same tab again.

Sign in to add a comment