chromium/components/saved_tab_groups/saved_tab_group.cc

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/saved_tab_groups/saved_tab_group.h"

#include <algorithm>
#include <optional>
#include <string>
#include <vector>

#include "base/notreached.h"
#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "base/uuid.h"
#include "components/saved_tab_groups/features.h"
#include "components/saved_tab_groups/saved_tab_group_tab.h"
#include "components/sync/protocol/saved_tab_group_specifics.pb.h"
#include "components/tab_groups/tab_group_color.h"
#include "components/tab_groups/tab_group_id.h"
#include "ui/gfx/image/image.h"
#include "url/gurl.h"

namespace tab_groups {

namespace {

bool ShouldPlaceNewTabBeforeExistingTab(const SavedTabGroupTab& new_tab,
                                        const SavedTabGroupTab& existing_tab) {}

}  // namespace

SavedTabGroup::SavedTabGroup(
    const std::u16string& title,
    const tab_groups::TabGroupColorId& color,
    const std::vector<SavedTabGroupTab>& urls,
    std::optional<size_t> position,
    std::optional<base::Uuid> saved_guid,
    std::optional<LocalTabGroupID> local_group_id,
    std::optional<std::string> creator_cache_guid,
    std::optional<std::string> last_updater_cache_guid,
    bool created_before_syncing_tab_groups,
    std::optional<base::Time> creation_time_windows_epoch_micros,
    std::optional<base::Time> update_time_windows_epoch_micros)
    :{}

SavedTabGroup::SavedTabGroup(const SavedTabGroup& other) = default;
SavedTabGroup& SavedTabGroup::operator=(const SavedTabGroup& other) = default;

SavedTabGroup::SavedTabGroup(SavedTabGroup&& other) = default;
SavedTabGroup& SavedTabGroup::operator=(SavedTabGroup&& other) = default;

SavedTabGroup::~SavedTabGroup() = default;

const SavedTabGroupTab* SavedTabGroup::GetTab(
    const base::Uuid& saved_tab_guid) const {}

const SavedTabGroupTab* SavedTabGroup::GetTab(
    const LocalTabID& local_tab_id) const {}

SavedTabGroupTab* SavedTabGroup::GetTab(const base::Uuid& saved_tab_guid) {}

SavedTabGroupTab* SavedTabGroup::GetTab(const LocalTabID& local_tab_id) {}

bool SavedTabGroup::ContainsTab(const base::Uuid& saved_tab_guid) const {}

bool SavedTabGroup::ContainsTab(const LocalTabID& local_tab_id) const {}

std::optional<int> SavedTabGroup::GetIndexOfTab(
    const base::Uuid& saved_tab_guid) const {}

std::optional<int> SavedTabGroup::GetIndexOfTab(
    const LocalTabID& local_tab_id) const {}

SavedTabGroup& SavedTabGroup::SetTitle(std::u16string title) {}

SavedTabGroup& SavedTabGroup::SetColor(tab_groups::TabGroupColorId color) {}

SavedTabGroup& SavedTabGroup::SetLocalGroupId(
    std::optional<LocalTabGroupID> tab_group_id) {}

SavedTabGroup& SavedTabGroup::SetCreatorCacheGuid(
    std::optional<std::string> new_cache_guid) {}

SavedTabGroup& SavedTabGroup::SetLastUpdaterCacheGuid(
    std::optional<std::string> cache_guid) {}

SavedTabGroup& SavedTabGroup::SetCreatedBeforeSyncingTabGroups(
    bool created_before_syncing_tab_groups) {}

SavedTabGroup& SavedTabGroup::SetUpdateTimeWindowsEpochMicros(
    base::Time update_time_windows_epoch_micros) {}

SavedTabGroup& SavedTabGroup::SetLastUserInteractionTime(
    base::Time last_user_interaction_time) {}

SavedTabGroup& SavedTabGroup::SetPosition(size_t position) {}

SavedTabGroup& SavedTabGroup::SetPinned(bool pinned) {}

SavedTabGroup& SavedTabGroup::SetCollaborationId(
    std::optional<std::string> collaboration_id) {}

SavedTabGroup& SavedTabGroup::AddTabLocally(SavedTabGroupTab tab) {}

SavedTabGroup& SavedTabGroup::AddTabFromSync(SavedTabGroupTab tab) {}

SavedTabGroup& SavedTabGroup::RemoveTabLocally(
    const base::Uuid& saved_tab_guid) {}

SavedTabGroup& SavedTabGroup::RemoveTabFromSync(
    const base::Uuid& saved_tab_guid) {}

SavedTabGroup& SavedTabGroup::UpdateTab(SavedTabGroupTab tab) {}

SavedTabGroup& SavedTabGroup::ReplaceTabAt(const base::Uuid& tab_id,
                                           SavedTabGroupTab tab) {}

SavedTabGroup& SavedTabGroup::MoveTabLocally(const base::Uuid& saved_tab_guid,
                                             size_t new_index) {}

SavedTabGroup& SavedTabGroup::MoveTabFromSync(const base::Uuid& saved_tab_guid,
                                              size_t new_index) {}

void SavedTabGroup::MoveTabImpl(const base::Uuid& saved_tab_guid,
                                size_t new_index) {}

void SavedTabGroup::InsertTabImpl(SavedTabGroupTab tab) {}

void SavedTabGroup::UpdateTabPositionsImpl() {}

bool SavedTabGroup::RemoteGroupHasMoreRecentUpdates(
    base::Time remote_group_update_time) const {}

void SavedTabGroup::MergeRemoteGroupMetadata(
    const std::u16string& title,
    TabGroupColorId color,
    std::optional<size_t> position,
    std::optional<std::string> creator_cache_guid,
    std::optional<std::string> last_updater_cache_guid,
    base::Time update_time) {}

bool SavedTabGroup::IsSyncEquivalent(const SavedTabGroup& other) const {}

void SavedTabGroup::RemoveTabImpl(const base::Uuid& saved_tab_guid) {}

}  // namespace tab_groups