| OLD | NEW |
| (Empty) |
| 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 | |
| 5 #include "chrome/browser/undo/bookmark_undo_utils.h" | |
| 6 | |
| 7 #include "chrome/browser/undo/bookmark_undo_service.h" | |
| 8 #include "chrome/browser/undo/undo_manager.h" | |
| 9 | |
| 10 // ScopedSuspendBookmarkUndo -------------------------------------------------- | |
| 11 | |
| 12 ScopedSuspendBookmarkUndo::ScopedSuspendBookmarkUndo( | |
| 13 BookmarkUndoService* bookmark_undo_service) | |
| 14 : undo_manager_(bookmark_undo_service | |
| 15 ? bookmark_undo_service->undo_manager() | |
| 16 : nullptr) { | |
| 17 if (undo_manager_) | |
| 18 undo_manager_->SuspendUndoTracking(); | |
| 19 } | |
| 20 | |
| 21 ScopedSuspendBookmarkUndo::~ScopedSuspendBookmarkUndo() { | |
| 22 if (undo_manager_) | |
| 23 undo_manager_->ResumeUndoTracking(); | |
| 24 } | |
| OLD | NEW |