bookmark_local_changes_builder.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright 2018 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_SYNC_BOOKMARKS_BOOKMARK_LOCAL_CHANGES_BUILDER_H_
  5. #define COMPONENTS_SYNC_BOOKMARKS_BOOKMARK_LOCAL_CHANGES_BUILDER_H_
  6. #include "base/memory/raw_ptr.h"
  7. #include "components/sync/engine/commit_and_get_updates_types.h"
  8. namespace bookmarks {
  9. class BookmarkModel;
  10. }
  11. namespace sync_bookmarks {
  12. class SyncedBookmarkTracker;
  13. class BookmarkLocalChangesBuilder {
  14. public:
  15. // |bookmark_tracker| and |bookmark_model| must not be null and must outlive
  16. // this object.
  17. BookmarkLocalChangesBuilder(SyncedBookmarkTracker* bookmark_tracker,
  18. bookmarks::BookmarkModel* bookmark_model);
  19. BookmarkLocalChangesBuilder(const BookmarkLocalChangesBuilder&) = delete;
  20. BookmarkLocalChangesBuilder& operator=(const BookmarkLocalChangesBuilder&) =
  21. delete;
  22. // Builds the commit requests list.
  23. syncer::CommitRequestDataList BuildCommitRequests(size_t max_entries) const;
  24. private:
  25. const raw_ptr<SyncedBookmarkTracker> bookmark_tracker_;
  26. const raw_ptr<bookmarks::BookmarkModel> bookmark_model_;
  27. };
  28. } // namespace sync_bookmarks
  29. #endif // COMPONENTS_SYNC_BOOKMARKS_BOOKMARK_LOCAL_CHANGES_BUILDER_H_