chromium/components/sync_sessions/local_session_event_handler_impl.cc

// Copyright 2018 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/sync_sessions/local_session_event_handler_impl.h"

#include <algorithm>
#include <map>
#include <utility>
#include <vector>

#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
#include "base/timer/elapsed_timer.h"
#include "components/sync/base/features.h"
#include "components/sync/base/time.h"
#include "components/sync/protocol/session_specifics.pb.h"
#include "components/sync/protocol/sync_enums.pb.h"
#include "components/sync_sessions/sync_sessions_client.h"
#include "components/sync_sessions/synced_session_tracker.h"
#include "components/sync_sessions/synced_tab_delegate.h"
#include "components/sync_sessions/synced_window_delegate.h"
#include "components/sync_sessions/synced_window_delegates_getter.h"

namespace sync_sessions {
namespace {

SerializedNavigationEntry;

// Enumeration of possible results when placeholder tabs are attempted to be
// resynced. Used in UMA metrics. Do not re-order or delete these entries; they
// are used in a UMA histogram. Please edit SyncPlaceholderTabResyncResult in
// enums.xml if a value is added.
// LINT.IfChange(SyncPlaceholderTabResyncResult)
enum PlaceholderTabResyncResultHistogramValue {};
// LINT.ThenChange(/tools/metrics/histograms/metadata/sync/enums.xml:SyncPlaceholderTabResyncResult)

// The maximum number of navigations in each direction we care to sync.
const int kMaxSyncNavigationCount =;

bool IsSessionRestoreInProgress(SyncSessionsClient* sessions_client) {}

bool IsWindowSyncable(const SyncedWindowDelegate& window_delegate) {}

// On Android, it's possible to not have any tabbed windows when only custom
// tabs are currently open. This means that there is tab data that will be
// restored later, but we cannot access it.
bool ScanForTabbedWindow(SyncedWindowDelegatesGetter* delegates_getter) {}

sync_pb::SyncEnums_BrowserType BrowserTypeFromWindowDelegate(
    const SyncedWindowDelegate& delegate) {}

#if BUILDFLAG(IS_ANDROID)
void RecordPlaceholderTabResyncResult(
    PlaceholderTabResyncResultHistogramValue result_value) {
  base::UmaHistogramEnumeration("Sync.PlaceholderTabResyncResult",
                                result_value);
}
#endif  // BUILDFLAG(IS_ANDROID)

}  // namespace

LocalSessionEventHandlerImpl::WriteBatch::WriteBatch() = default;

LocalSessionEventHandlerImpl::WriteBatch::~WriteBatch() = default;

LocalSessionEventHandlerImpl::Delegate::~Delegate() = default;

LocalSessionEventHandlerImpl::LocalSessionEventHandlerImpl(
    Delegate* delegate,
    SyncSessionsClient* sessions_client,
    SyncedSessionTracker* session_tracker)
    :{}

LocalSessionEventHandlerImpl::~LocalSessionEventHandlerImpl() = default;

void LocalSessionEventHandlerImpl::OnSessionRestoreComplete() {}

sync_pb::SessionTab
LocalSessionEventHandlerImpl::GetTabSpecificsFromDelegateForTest(
    SyncedTabDelegate& tab_delegate) const {}

void LocalSessionEventHandlerImpl::CleanupLocalTabs(WriteBatch* batch) {}

void LocalSessionEventHandlerImpl::AssociateWindows(ReloadTabsOption option,
                                                    WriteBatch* batch,
                                                    bool is_session_restore) {}

void LocalSessionEventHandlerImpl::AssociateTab(
    SyncedTabDelegate* const tab_delegate,
    WriteBatch* batch) {}

void LocalSessionEventHandlerImpl::OnLocalTabModified(
    SyncedTabDelegate* modified_tab) {}

sync_pb::SessionTab LocalSessionEventHandlerImpl::GetTabSpecificsFromDelegate(
    SyncedTabDelegate& tab_delegate) const {}

bool LocalSessionEventHandlerImpl::AssociatePlaceholderTab(
    std::unique_ptr<SyncedTabDelegate> snapshot,
    WriteBatch* batch) {}

}  // namespace sync_sessions