#include "chrome/browser/ui/tabs/saved_tab_groups/local_tab_group_listener.h"
#include <unordered_map>
#include "base/feature_list.h"
#include "base/token.h"
#include "chrome/browser/tab_group_sync/tab_group_sync_utils.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_utils.h"
#include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_web_contents_listener.h"
#include "chrome/browser/ui/tabs/saved_tab_groups/tab_group_sync_service_proxy.h"
#include "chrome/browser/ui/tabs/tab_group.h"
#include "chrome/browser/ui/tabs/tab_group_model.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "components/saved_tab_groups/features.h"
#include "components/saved_tab_groups/saved_tab_group_model.h"
#include "components/saved_tab_groups/saved_tab_group_tab.h"
#include "components/saved_tab_groups/utils.h"
#include "content/public/browser/web_contents.h"
namespace tab_groups {
LocalTabGroupListener::LocalTabGroupListener(
const tab_groups::TabGroupId local_id,
const base::Uuid saved_guid,
TabGroupSyncService* service,
std::map<content::WebContents*, base::Uuid> web_contents_to_uuid)
: … { … }
LocalTabGroupListener::~LocalTabGroupListener() = default;
void LocalTabGroupListener::PauseTracking() { … }
void LocalTabGroupListener::ResumeTracking() { … }
bool LocalTabGroupListener::IsTrackingPaused() const { … }
void LocalTabGroupListener::UpdateVisualDataFromLocal(
const TabGroupChange::VisualsChange* visual_change) { … }
void LocalTabGroupListener::OnReplaceWebContents(
content::WebContents* old_web_contents,
content::WebContents* new_web_contents) { … }
void LocalTabGroupListener::AddWebContentsFromLocal(
content::WebContents* web_contents,
TabStripModel* tab_strip_model,
int index) { … }
void LocalTabGroupListener::MoveWebContentsFromLocal(
TabStripModel* tab_strip_model,
content::WebContents* web_contents,
int tabstrip_index_of_moved_tab) { … }
LocalTabGroupListener::Liveness
LocalTabGroupListener::MaybeRemoveWebContentsFromLocal(
content::WebContents* web_contents) { … }
void LocalTabGroupListener::GroupRemovedFromSync() { … }
LocalTabGroupListener::Liveness LocalTabGroupListener::UpdateFromSync() { … }
void LocalTabGroupListener::MatchLocalTabToSavedTab(
SavedTabGroupTab saved_tab,
content::WebContents* local_tab,
TabStripModel* tab_strip_model,
int target_index_in_tab_strip) { … }
void LocalTabGroupListener::OpenWebContentsFromSync(SavedTabGroupTab tab,
Browser* browser,
int index_in_tabstrip) { … }
void LocalTabGroupListener::RemoveLocalWebContentsNotInSavedGroup() { … }
void LocalTabGroupListener::RemoveWebContentsFromSync(
content::WebContents* contents,
bool should_close_tab) { … }
}