chromium/components/saved_tab_groups/saved_tab_group_model.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_model.h"

#include <algorithm>
#include <cstddef>
#include <memory>
#include <optional>
#include <vector>

#include "base/feature_list.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/user_metrics.h"
#include "base/metrics/user_metrics_action.h"
#include "base/observer_list.h"
#include "base/strings/utf_string_conversions.h"
#include "base/uuid.h"
#include "components/saved_tab_groups/features.h"
#include "components/saved_tab_groups/saved_tab_group.h"
#include "components/saved_tab_groups/saved_tab_group_model_observer.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 "components/tab_groups/tab_group_visual_data.h"

namespace tab_groups {
namespace {

void RecordGroupDeletedMetric(const SavedTabGroup& removed_group) {}

// Compare function for 2 SavedTabGroup.
// SaveTabGroup with position set is always placed before the one without
// position set. If both have position set, the one with lower position number
// should place before. If both positions are the same or both are not set, the
// one with more recent update time should place before.
bool ShouldPlaceBefore(const SavedTabGroup& group1,
                       const SavedTabGroup& group2) {}

}  // anonymous namespace

SavedTabGroupModel::SavedTabGroupModel() = default;
SavedTabGroupModel::~SavedTabGroupModel() = default;

std::vector<const SavedTabGroup*> SavedTabGroupModel::GetSavedTabGroupsOnly()
    const {}

std::vector<const SavedTabGroup*> SavedTabGroupModel::GetSharedTabGroupsOnly()
    const {}

std::optional<int> SavedTabGroupModel::GetIndexOf(
    LocalTabGroupID tab_group_id) const {}

std::optional<int> SavedTabGroupModel::GetIndexOf(const base::Uuid& id) const {}

std::optional<bool> SavedTabGroupModel::IsGroupPinned(
    const base::Uuid& id) const {}

const SavedTabGroup* SavedTabGroupModel::Get(const base::Uuid& id) const {}

const SavedTabGroup* SavedTabGroupModel::Get(
    const LocalTabGroupID local_group_id) const {}

void SavedTabGroupModel::Add(SavedTabGroup saved_group) {}

void SavedTabGroupModel::Remove(const LocalTabGroupID tab_group_id) {}

void SavedTabGroupModel::Remove(const base::Uuid& id) {}

void SavedTabGroupModel::UpdateVisualData(
    LocalTabGroupID tab_group_id,
    const tab_groups::TabGroupVisualData* visual_data) {}

void SavedTabGroupModel::MakeTabGroupShared(
    const LocalTabGroupID& local_group_id,
    std::string collaboration_id) {}

void SavedTabGroupModel::AddedFromSync(SavedTabGroup saved_group) {}

void SavedTabGroupModel::RemovedFromSync(const LocalTabGroupID tab_group_id) {}

void SavedTabGroupModel::RemovedFromSync(const base::Uuid& id) {}

void SavedTabGroupModel::UpdatedVisualDataFromSync(
    LocalTabGroupID tab_group_id,
    const tab_groups::TabGroupVisualData* visual_data) {}

void SavedTabGroupModel::UpdatedVisualDataFromSync(
    const base::Uuid& id,
    const tab_groups::TabGroupVisualData* visual_data) {}

const SavedTabGroup* SavedTabGroupModel::GetGroupContainingTab(
    const base::Uuid& saved_tab_guid) const {}

const SavedTabGroup* SavedTabGroupModel::GetGroupContainingTab(
    const LocalTabID& local_tab_id) const {}

void SavedTabGroupModel::AddTabToGroupLocally(const base::Uuid& group_id,
                                              SavedTabGroupTab tab) {}

void SavedTabGroupModel::AddTabToGroupFromSync(const base::Uuid& group_id,
                                               SavedTabGroupTab tab) {}

void SavedTabGroupModel::UpdateTabInGroup(const base::Uuid& group_id,
                                          SavedTabGroupTab tab) {}

void SavedTabGroupModel::UpdateLocalTabId(const base::Uuid& group_id,
                                          SavedTabGroupTab tab,
                                          std::optional<LocalTabID> local_id) {}

void SavedTabGroupModel::RemoveTabFromGroupLocally(const base::Uuid& group_id,
                                                   const base::Uuid& tab_id) {}

void SavedTabGroupModel::RemoveTabFromGroupFromSync(const base::Uuid& group_id,
                                                    const base::Uuid& tab_id) {}

void SavedTabGroupModel::MoveTabInGroupTo(const base::Uuid& group_id,
                                          const base::Uuid& tab_id,
                                          int new_index) {}

void SavedTabGroupModel::UpdateLastUserInteractionTimeLocally(
    const LocalTabGroupID& local_group_id) {}

void SavedTabGroupModel::UpdateLastUpdaterCacheGuidForGroup(
    const std::optional<std::string>& cache_guid,
    const LocalTabGroupID& group_id,
    const std::optional<LocalTabID>& tab_id) {}

const SavedTabGroup* SavedTabGroupModel::MergeRemoteGroupMetadata(
    const base::Uuid& guid,
    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) {}

const SavedTabGroupTab* SavedTabGroupModel::MergeRemoteTab(
    const SavedTabGroupTab& remote_tab) {}

void SavedTabGroupModel::ReorderGroupLocally(const base::Uuid& id,
                                             int new_index) {}

void SavedTabGroupModel::ReorderGroupFromSync(const base::Uuid& id,
                                              int new_index) {}

std::pair<std::set<base::Uuid>, std::set<base::Uuid>>
SavedTabGroupModel::UpdateLocalCacheGuid(
    std::optional<std::string> old_cache_guid,
    std::optional<std::string> new_cache_guid) {}

void SavedTabGroupModel::LoadStoredEntries(std::vector<SavedTabGroup> groups,
                                           std::vector<SavedTabGroupTab> tabs) {}

void SavedTabGroupModel::OnGroupClosedInTabStrip(
    const LocalTabGroupID& tab_group_id) {}

void SavedTabGroupModel::OnGroupOpenedInTabStrip(
    const base::Uuid& id,
    const LocalTabGroupID& tab_group_id) {}

void SavedTabGroupModel::AddObserver(SavedTabGroupModelObserver* observer) {}

void SavedTabGroupModel::RemoveObserver(SavedTabGroupModelObserver* observer) {}

void SavedTabGroupModel::MigrateTabGroupSavesUIUpdate() {}

SavedTabGroup* SavedTabGroupModel::MutableGroupContainingTab(
    const base::Uuid& saved_tab_guid) {}

SavedTabGroup* SavedTabGroupModel::GetMutableGroup(
    const LocalTabGroupID& local_group_id) {}

SavedTabGroup* SavedTabGroupModel::GetMutableGroup(const base::Uuid& id) {}

void SavedTabGroupModel::ReorderGroupImpl(const base::Uuid& id, int new_index) {}

void SavedTabGroupModel::UpdateGroupPositionsImpl() {}

void SavedTabGroupModel::InsertGroupImpl(SavedTabGroup group) {}

SavedTabGroup SavedTabGroupModel::RemoveImpl(size_t index) {}

void SavedTabGroupModel::UpdateVisualDataImpl(
    int index,
    const tab_groups::TabGroupVisualData* visual_data) {}

void SavedTabGroupModel::TogglePinState(base::Uuid id) {}

}  // namespace tab_groups