bookmark_undo_utils.h 988 B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright 2014 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_UNDO_BOOKMARK_UNDO_UTILS_H_
  5. #define COMPONENTS_UNDO_BOOKMARK_UNDO_UTILS_H_
  6. #include "base/memory/raw_ptr.h"
  7. class BookmarkUndoService;
  8. class UndoManager;
  9. // ScopedSuspendBookmarkUndo --------------------------------------------------
  10. // Scopes the suspension of the undo tracking for non-user initiated changes
  11. // such as those occuring during account synchronization.
  12. class ScopedSuspendBookmarkUndo {
  13. public:
  14. explicit ScopedSuspendBookmarkUndo(
  15. BookmarkUndoService* bookmark_undo_service);
  16. ScopedSuspendBookmarkUndo(const ScopedSuspendBookmarkUndo&) = delete;
  17. ScopedSuspendBookmarkUndo& operator=(const ScopedSuspendBookmarkUndo&) =
  18. delete;
  19. ~ScopedSuspendBookmarkUndo();
  20. private:
  21. raw_ptr<UndoManager> undo_manager_;
  22. };
  23. #endif // COMPONENTS_UNDO_BOOKMARK_UNDO_UTILS_H_