
The data types are enabled behind a feature toggle (disabled by default until sync bridges are implemented). Bug: 1445868 Change-Id: Id8b23755f18f3b73868a71d3b681da20bb9c6599 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4679690 Reviewed-by: Mohamed Amir Yosef <mamir@chromium.org> Commit-Queue: Rushan Suleymanov <rushans@google.com> Reviewed-by: Marc Treib <treib@chromium.org> Cr-Commit-Position: refs/heads/main@{#1170144}
85 lines
2.7 KiB
C++
85 lines
2.7 KiB
C++
// Copyright 2019 The Chromium Authors
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef COMPONENTS_BROWSER_SYNC_BROWSER_SYNC_CLIENT_H_
|
|
#define COMPONENTS_BROWSER_SYNC_BROWSER_SYNC_CLIENT_H_
|
|
|
|
#include "base/functional/callback_forward.h"
|
|
#include "base/memory/weak_ptr.h"
|
|
#include "components/sync/model/model_type_controller_delegate.h"
|
|
#include "components/sync/service/sync_client.h"
|
|
|
|
namespace favicon {
|
|
class FaviconService;
|
|
} // namespace favicon
|
|
|
|
namespace history {
|
|
class HistoryService;
|
|
} // namespace history
|
|
|
|
class ReadingListModel;
|
|
|
|
namespace password_manager {
|
|
class PasswordReceiverService;
|
|
class PasswordSenderService;
|
|
} // namespace password_manager
|
|
|
|
namespace send_tab_to_self {
|
|
class SendTabToSelfSyncService;
|
|
} // namespace send_tab_to_self
|
|
|
|
namespace sync_preferences {
|
|
class PrefServiceSyncable;
|
|
} // namespace sync_preferences
|
|
|
|
namespace sync_sessions {
|
|
class SessionSyncService;
|
|
} // namespace sync_sessions
|
|
|
|
namespace syncer {
|
|
class DeviceInfoSyncService;
|
|
class ModelTypeStoreService;
|
|
} // namespace syncer
|
|
|
|
namespace browser_sync {
|
|
|
|
// Extension to interface syncer::SyncClient to bundle dependencies that
|
|
// sync-the-feature requires for datatypes common to all platforms.
|
|
// Note: on some platforms, getters might return nullptr. Callers are expected
|
|
// to handle these scenarios gracefully.
|
|
class BrowserSyncClient : public syncer::SyncClient {
|
|
public:
|
|
BrowserSyncClient() = default;
|
|
|
|
BrowserSyncClient(const BrowserSyncClient&) = delete;
|
|
BrowserSyncClient& operator=(const BrowserSyncClient&) = delete;
|
|
|
|
~BrowserSyncClient() override = default;
|
|
|
|
virtual syncer::ModelTypeStoreService* GetModelTypeStoreService() = 0;
|
|
|
|
// Returns a weak pointer to the ModelTypeControllerDelegate specified by
|
|
// |type|. Weak pointer may be unset if service is already destroyed.
|
|
virtual base::WeakPtr<syncer::ModelTypeControllerDelegate>
|
|
GetControllerDelegateForModelType(syncer::ModelType type) = 0;
|
|
|
|
// DataType specific service getters.
|
|
virtual syncer::DeviceInfoSyncService* GetDeviceInfoSyncService() = 0;
|
|
virtual favicon::FaviconService* GetFaviconService() = 0;
|
|
virtual history::HistoryService* GetHistoryService() = 0;
|
|
virtual password_manager::PasswordReceiverService*
|
|
GetPasswordReceiverService() = 0;
|
|
virtual password_manager::PasswordSenderService*
|
|
GetPasswordSenderService() = 0;
|
|
virtual sync_preferences::PrefServiceSyncable* GetPrefServiceSyncable() = 0;
|
|
virtual sync_sessions::SessionSyncService* GetSessionSyncService() = 0;
|
|
virtual ReadingListModel* GetReadingListModel() = 0;
|
|
virtual send_tab_to_self::SendTabToSelfSyncService*
|
|
GetSendTabToSelfSyncService() = 0;
|
|
};
|
|
|
|
} // namespace browser_sync
|
|
|
|
#endif // COMPONENTS_BROWSER_SYNC_BROWSER_SYNC_CLIENT_H_
|