-
Notifications
You must be signed in to change notification settings - Fork 879
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2c8eba9
commit 16c516c
Showing
11 changed files
with
199 additions
and
277 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 0 additions & 100 deletions
100
chromium_src/components/sync_bookmarks/bookmark_change_processor.cc
This file was deleted.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
chromium_src/components/sync_bookmarks/bookmark_model_type_processor.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* Copyright 2020 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#include "components/sync_bookmarks/bookmark_model_observer_impl.h" | ||
|
||
#include <utility> | ||
|
||
namespace sync_bookmarks { | ||
|
||
class BraveBookmarkModelObserverImpl : public BookmarkModelObserverImpl { | ||
public: | ||
// |bookmark_tracker_| must not be null and must outlive this object. | ||
BraveBookmarkModelObserverImpl( | ||
const base::RepeatingClosure& nudge_for_commit_closure, | ||
base::OnceClosure on_bookmark_model_being_deleted_closure, | ||
SyncedBookmarkTracker* bookmark_tracker) | ||
: BookmarkModelObserverImpl( | ||
nudge_for_commit_closure, | ||
std::move(on_bookmark_model_being_deleted_closure), | ||
bookmark_tracker) {} | ||
~BraveBookmarkModelObserverImpl() override = default; | ||
|
||
// BookmarkModelObserver: | ||
void BookmarkMetaInfoChanged(bookmarks::BookmarkModel* model, | ||
const bookmarks::BookmarkNode* node) override {} | ||
void BookmarkNodeFaviconChanged( | ||
bookmarks::BookmarkModel* model, | ||
const bookmarks::BookmarkNode* node) override {} | ||
|
||
private: | ||
DISALLOW_COPY_AND_ASSIGN(BraveBookmarkModelObserverImpl); | ||
}; | ||
|
||
} // namespace sync_bookmarks | ||
|
||
#define BookmarkModelObserverImpl BraveBookmarkModelObserverImpl | ||
#include "../../../../components/sync_bookmarks/bookmark_model_type_processor.cc" | ||
#undef BookmarkModelObserverImpl |
28 changes: 28 additions & 0 deletions
28
chromium_src/components/sync_bookmarks/bookmark_remote_updates_handler.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* Copyright 2020 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#include "brave/components/brave_sync/syncer_helper.h" | ||
|
||
#define BRAVE_APPLY_REMOTE_UPDATE true ? brave_sync::GetIndex(new_parent, node): | ||
|
||
#define BRAVE_PROCESS_CREATE_1 \ | ||
std::string order; \ | ||
std::string object_id; \ | ||
for (int i = 0; i < update_entity.specifics.bookmark().meta_info_size(); \ | ||
++i) { \ | ||
if (update_entity.specifics.bookmark().meta_info(i).key() == "order") { \ | ||
order = update_entity.specifics.bookmark().meta_info(i).value(); \ | ||
} else if (update_entity.specifics.bookmark().meta_info(i).key() == \ | ||
"object_id") { \ | ||
object_id = update_entity.specifics.bookmark().meta_info(i).value(); \ | ||
} \ | ||
} | ||
|
||
#define BRAVE_PROCESS_CREATE_2 \ | ||
true ? brave_sync::GetIndex(parent_node, order, object_id): | ||
#include "../../../../components/sync_bookmarks/bookmark_remote_updates_handler.cc" | ||
#undef BRAVE_APPLY_REMOTE_UPDATE | ||
#undef BRAVE_PROCESS_CREATE_1 | ||
#undef BRAVE_PROCESS_CREATE_2 |
25 changes: 25 additions & 0 deletions
25
chromium_src/components/sync_bookmarks/bookmark_specifics_conversions.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* Copyright 2020 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#include "components/sync_bookmarks/bookmark_specifics_conversions.h" | ||
|
||
#include "brave/components/brave_sync/syncer_helper.h" | ||
#define CreateSpecificsFromBookmarkNode \ | ||
CreateSpecificsFromBookmarkNodeChromiumImpl | ||
#include "../../../../components/sync_bookmarks/bookmark_specifics_conversions.cc" | ||
#undef CreateSpecificsFromBookmarkNode | ||
|
||
namespace sync_bookmarks { | ||
|
||
sync_pb::EntitySpecifics CreateSpecificsFromBookmarkNode( | ||
const bookmarks::BookmarkNode* node, | ||
bookmarks::BookmarkModel* model, | ||
bool force_favicon_load) { | ||
brave_sync::AddBraveMetaInfo(node); | ||
return CreateSpecificsFromBookmarkNodeChromiumImpl(node, model, | ||
force_favicon_load); | ||
} | ||
|
||
} // namespace sync_bookmarks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.