Skip to content

Commit

Permalink
Implement OnSaveBookmarkOrder from #2326
Browse files Browse the repository at this point in the history
  • Loading branch information
darkdh committed Apr 25, 2019
1 parent 9c6cb94 commit 8c4cb39
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
14 changes: 14 additions & 0 deletions chromium_src/components/browser_sync/profile_sync_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,20 @@ void ProfileSyncService::OnSaveBookmarksBaseOrder(const std::string& order) {
OnSyncReady();
}

void ProfileSyncService::OnSaveBookmarkOrder(const std::string& object_id,
const std::string& order) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK(!order.empty());
bookmarks::BookmarkModel* model =
// TODO(darkdh): find another way to obtain bookmark model
// change introduced in 83b9663e3814ef7e53af5009d10033b89955db44
static_cast<ChromeSyncClient*>(sync_client_.get())->GetBookmarkModel();
auto* node = FindByObjectId(model, object_id);
if (node) {
model->SetNodeMetaInfo(node, "order", order);
}
}

void ProfileSyncService::OnSyncWordsPrepared(const std::string& words) {
NotifyHaveSyncWords(words);
}
Expand Down
8 changes: 5 additions & 3 deletions patches/components-browser_sync-profile_sync_service.h.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/components/browser_sync/profile_sync_service.h b/components/browser_sync/profile_sync_service.h
index 6c01395b954ac146084865b0268992f277b4914c..c23fc377beaebcef2a894e8c4e2f9f76e77d58d6 100644
index 6c01395b954ac146084865b0268992f277b4914c..e6c7eb64cf1167f58159cdfd4c9f58f62b620451 100644
--- a/components/browser_sync/profile_sync_service.h
+++ b/components/browser_sync/profile_sync_service.h
@@ -137,7 +137,9 @@ class ProfileSyncService : public syncer::SyncService,
Expand All @@ -13,7 +13,7 @@ index 6c01395b954ac146084865b0268992f277b4914c..c23fc377beaebcef2a894e8c4e2f9f76
public:
// If AUTO_START, sync will set IsFirstSetupComplete() automatically and sync
// will begin syncing without the user needing to confirm sync settings.
@@ -346,6 +348,42 @@ class ProfileSyncService : public syncer::SyncService,
@@ -346,6 +348,44 @@ class ProfileSyncService : public syncer::SyncService,

syncer::SyncClient* GetSyncClientForTest();

Expand Down Expand Up @@ -51,12 +51,14 @@ index 6c01395b954ac146084865b0268992f277b4914c..c23fc377beaebcef2a894e8c4e2f9f76
+ void OnDeletedSyncUser() override;
+ void OnDeleteSyncSiteSettings() override;
+ void OnSaveBookmarksBaseOrder(const std::string& order) override;
+ void OnSaveBookmarkOrder(const std::string& object_id,
+ const std::string& order) override;
+ void OnSyncWordsPrepared(const std::string& words) override;
+
private:
// Passed as an argument to StopImpl to control whether or not the sync
// engine should clear its data directory when it shuts down. See StopImpl
@@ -465,6 +503,47 @@ class ProfileSyncService : public syncer::SyncService,
@@ -465,6 +505,47 @@ class ProfileSyncService : public syncer::SyncService,
// Called by SyncServiceCrypto when a passphrase is required or accepted.
void ReconfigureDueToPassphrase(syncer::ConfigureReason reason);

Expand Down

0 comments on commit 8c4cb39

Please sign in to comment.