#include "chrome/browser/ui/tabs/saved_tab_groups/tab_group_sync_delegate_desktop.h"
#include <map>
#include "base/containers/contains.h"
#include "base/uuid.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_model_listener.h"
#include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_service_factory.h"
#include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_utils.h"
#include "chrome/browser/ui/tabs/saved_tab_groups/tab_group_action_context_desktop.h"
#include "chrome/browser/ui/tabs/saved_tab_groups/tab_group_sync_service_proxy.h"
#include "chrome/browser/ui/tabs/tab_group_model.h"
#include "chrome/browser/ui/tabs/tab_model.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "components/saved_tab_groups/tab_group_sync_service.h"
#include "components/saved_tab_groups/types.h"
#include "content/public/browser/web_contents.h"
#include "ui/gfx/range/range.h"
namespace tab_groups {
namespace {
class ScopedLocalObservationPauserImpl : public ScopedLocalObservationPauser { … };
ScopedLocalObservationPauserImpl::ScopedLocalObservationPauserImpl(
SavedTabGroupModelListener* listener)
: … { … }
ScopedLocalObservationPauserImpl::~ScopedLocalObservationPauserImpl() { … }
}
TabGroupSyncDelegateDesktop::TabGroupSyncDelegateDesktop(
TabGroupSyncService* service,
Profile* profile)
: … { … }
TabGroupSyncDelegateDesktop::~TabGroupSyncDelegateDesktop() = default;
void TabGroupSyncDelegateDesktop::HandleOpenTabGroupRequest(
const base::Uuid& sync_tab_group_id,
std::unique_ptr<TabGroupActionContext> context) { … }
void TabGroupSyncDelegateDesktop::CreateLocalTabGroup(
const SavedTabGroup& tab_group) { … }
void TabGroupSyncDelegateDesktop::CloseLocalTabGroup(
const LocalTabGroupID& local_id) { … }
void TabGroupSyncDelegateDesktop::UpdateLocalTabGroup(
const SavedTabGroup& group) { … }
std::vector<LocalTabGroupID>
TabGroupSyncDelegateDesktop::GetLocalTabGroupIds() { … }
std::vector<LocalTabID> TabGroupSyncDelegateDesktop::GetLocalTabIdsForTabGroup(
const LocalTabGroupID& local_tab_group_id) { … }
void TabGroupSyncDelegateDesktop::CreateRemoteTabGroup(
const LocalTabGroupID& local_tab_group_id) { … }
std::unique_ptr<ScopedLocalObservationPauser>
TabGroupSyncDelegateDesktop::CreateScopedLocalObserverPauser() { … }
std::map<content::WebContents*, base::Uuid>
TabGroupSyncDelegateDesktop::OpenTabsAndMapWebcontentsToTabUUIDs(
Browser* const browser,
const SavedTabGroup& saved_group) { … }
TabGroupId TabGroupSyncDelegateDesktop::AddOpenedTabsToGroup(
TabStripModel* tab_strip_model,
const std::map<content::WebContents*, base::Uuid>&
opened_web_contents_to_uuid,
const SavedTabGroup& saved_group) { … }
}