DescriptionForeign tab suggestions should update when disabling sync or signing out.
Previously we were responding to OnSyncConfigurationCompleted by
invoking our callback to regenerate suggestions. This covered initial
sync setup, along with enabling or disabling any types from sync, in
case Open Tabs was one of the types that was changing. However, when
sync is completely disabled or the user signs out, we don't perform an
configuration, but session data is no longer there. We want to clear
our suggestions, but the hook we were using isn't called.
The approach this CL takes is to switch to using OnStateChanged for
this tracking. This event is called extremely often, for a variety of
things. Because generating suggestions when there are actual sessions
data is not computationally trivial, we only want to invoke the
callback in TabDelegateSyncAdapter when it is reasonable to do so, so
we've added a bool state variable to track the previous state, and only
invoke the callback when we're transitioning between states.
Note that this change does not mean that the current or any existing
NTPs are going to remove their foreign sessions data. By having the
ForeignSessionsSuggestionsProvider provide new suggestions, this
current only seems to affect NTPs that are opened afterwards.
BUG=669041
Committed: https://crrev.com/2fc56e330bdaef8b163ef126bb2a81c4d946ac43
Cr-Commit-Position: refs/heads/master@{#439578}
Patch Set 1 #Patch Set 2 : Self review. #Patch Set 3 : Removing a const gmock argument in hopes to fix msvc/gmock compile failure. #Patch Set 4 : How about without the const at all. #Patch Set 5 : Adding the const back to .cc #
Total comments: 10
Patch Set 6 : Updates for comments. #Patch Set 7 : Updated comment again. #
Total comments: 1
Patch Set 8 : Updating comment. #Patch Set 9 : Fixed more spelling errors. #
Messages
Total messages: 40 (29 generated)
|