[Sync] Restore previous session if no tabbed windows present
First, adds logic to support restoring the in-memory representation of the local
session based on the previous synced version of that session. This involves
updating rewriting SessionIds and updating the SyncedSessionTracker on each
startup.
Second, adds logic to include the previously synced session as part of
reassociation if the current session have at least one tabbed window. This
addresses the issue in Android where a custom tab can be opened without the
original Chrome for Android session being restored. We still want to sync the
custom tab's data, but don't want to lose the old session.
Lastly, this fixes an issue where the default value for Sync ids that are
persisted outside of sync (e.g. in the Android Tab state) were being initialized
to 0. 0 Is a valid sync id, so initialize them to -1.
BUG=639009
Review-Url: https://codereview.chromium.org/2791183003
Cr-Commit-Position: refs/heads/master@{#465156}
11 files changed