0

[SavedTabGroups] Default save unsaved when updating from V1 to V2

This CL addresses 4 different issues with enabling default save in V2,

1) Enabled default save of groups restored from session
2) Fixed to support asynchronous saving of groups at startup since
the model initialization might have not completed
3) Fixed an issue where session data wasn't restored correctly for the
saved GUID when there were multiple records in the append log
4) Tab Group session metadata was only updated when there was a change
in visual data. This led to cases where the saved GUID wasn't updated.
This was updated to listen for saved tab group model changes when groups
were saved or unsaved

Change-Id: I4d2255c11ad4022be701f0ee32115f5d8977ae6a
Bug: 344016224
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5608434
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: David Pennington <dpenning@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Darryl James <dljames@chromium.org>
Commit-Queue: Eshwar Stalin <estalin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1313032}
This commit is contained in:
Eshwar Stalin
2024-06-10 20:47:30 +00:00
committed by Chromium LUCI CQ
parent 520e6e37c9
commit e70c29e773
13 changed files with 358 additions and 84 deletions

@ -690,8 +690,12 @@ void CreateTabsAndWindows(
if (!iter.ReadString(&saved_guid)) {
return;
}
group->saved_guid = saved_guid;
} else {
// Explicitly update the |saved_guid| to nullopt if the group
// isn't saved. This is to ensure the right value is set when there
// are multiple entries in the append log file.
group->saved_guid = std::nullopt;
}
break;

@ -1265,6 +1265,11 @@ void TabRestoreServiceImpl::PersistenceDelegate::CreateEntriesFromCommands(
break;
}
current_tab->saved_group_id = base::Uuid::ParseLowercase(saved_id);
} else {
// Explicitly update the nullopt if the group isn't saved. This is to
// ensure the right value is set when there are multiple entries in
// the append log file.
current_tab->saved_group_id = std::nullopt;
}
current_tab->group =