@@ -6,10 +6,9 @@ syncer::SyncCredentials GetDummyCredentials();
66AccountInfo GetDummyAccountInfo ();
77}
88}
9- namespace syncer {
10- const int64_t kBraveDefaultShortPollIntervalSeconds = 60 ;
11- const int64_t kBraveDefaultLongPollIntervalSeconds = 90 ;
12- }
9+
10+ // For use_transport_only_mode
11+ #define IsSyncFeatureEnabled IsBraveSyncEnabled
1312#include " ../../../../components/browser_sync/profile_sync_service.cc"
1413
1514#include " base/bind.h"
@@ -22,12 +21,18 @@ const int64_t kBraveDefaultLongPollIntervalSeconds = 90;
2221#include " brave/components/brave_sync/sync_devices.h"
2322#include " brave/components/brave_sync/tools.h"
2423#include " brave/components/brave_sync/values_conv.h"
24+ #include " chrome/browser/sync/chrome_sync_client.h"
2525#include " components/bookmarks/browser/bookmark_model.h"
2626#include " components/sync/engine_impl/syncer.h"
2727#include " content/public/browser/browser_thread.h"
2828#include " net/base/network_interfaces.h"
2929#include " ui/base/models/tree_node_iterator.h"
3030
31+ namespace syncer {
32+ const int64_t kBraveDefaultShortPollIntervalSeconds = 60 ;
33+ const int64_t kBraveDefaultLongPollIntervalSeconds = 90 ;
34+ }
35+
3136namespace browser_sync {
3237
3338using brave_sync::GetRecordsCallback;
@@ -484,9 +489,6 @@ void ProfileSyncService::OnSaveInitData(const Uint8Array& seed,
484489
485490 brave_sync_configured_ = true ;
486491
487- user_settings_->SetChosenDataTypes (false , syncer::ModelTypeSet ());
488- OnSetSyncBookmarks (true );
489-
490492 brave_sync_initializing_ = false ;
491493}
492494
@@ -504,6 +506,8 @@ void ProfileSyncService::OnSyncReady() {
504506 DCHECK (false == brave_sync_initialized_);
505507 brave_sync_initialized_ = true ;
506508
509+ user_settings_->SetChosenDataTypes (false , syncer::ModelTypeSet ());
510+ OnSetSyncBookmarks (true );
507511 user_settings_->SetSyncRequested (true );
508512}
509513
@@ -524,7 +528,9 @@ void ProfileSyncService::OnGetExistingObjects(
524528 std::make_unique<SyncRecordAndExistingList>();
525529 CreateResolveList (
526530 *records.get (), records_and_existing_objects.get (),
527- sync_client_->GetBookmarkModel (),
531+ // TODO(darkdh): find another way to obtain bookmark model
532+ // change introduced in 83b9663e3814ef7e53af5009d10033b89955db44
533+ static_cast <ChromeSyncClient*>(sync_client_.get ())->GetBookmarkModel (),
528534 brave_sync_prefs_.get ());
529535 GetBraveSyncClient ()->SendResolveSyncRecords (
530536 category_name, std::move (records_and_existing_objects));
@@ -764,6 +770,15 @@ void ProfileSyncService::BraveEngineParamsInit(
764770 params->poll_sync_cycle_delegate_function =
765771 base::BindRepeating (&ProfileSyncService::OnPollSyncCycle,
766772 sync_enabled_weak_factory_.GetWeakPtr ());
773+
774+ params->credentials = GetDummyCredentials ();
775+
776+ sync_prefs_.SetShortPollInterval (
777+ base::TimeDelta::FromSeconds (
778+ syncer::kBraveDefaultShortPollIntervalSeconds ));
779+ sync_prefs_.SetLongPollInterval (
780+ base::TimeDelta::FromSeconds (
781+ syncer::kBraveDefaultLongPollIntervalSeconds ));
767782}
768783
769784void ProfileSyncService::OnNudgeSyncCycle (
0 commit comments