| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/undo/bookmark_undo_utils.h" | 5 #include "chrome/browser/undo/bookmark_undo_utils.h" |
| 6 | 6 |
| 7 #include "chrome/browser/undo/bookmark_undo_service.h" | 7 #include "chrome/browser/undo/bookmark_undo_service.h" |
| 8 #include "chrome/browser/undo/bookmark_undo_service_factory.h" | 8 #include "chrome/browser/undo/bookmark_undo_service_factory.h" |
| 9 #include "chrome/browser/undo/undo_manager.h" | 9 #include "chrome/browser/undo/undo_manager.h" |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 UndoManager* undo_manager = GetUndoManager(profile_); | 26 UndoManager* undo_manager = GetUndoManager(profile_); |
| 27 if (undo_manager) | 27 if (undo_manager) |
| 28 undo_manager->SuspendUndoTracking(); | 28 undo_manager->SuspendUndoTracking(); |
| 29 } | 29 } |
| 30 | 30 |
| 31 ScopedSuspendBookmarkUndo::~ScopedSuspendBookmarkUndo() { | 31 ScopedSuspendBookmarkUndo::~ScopedSuspendBookmarkUndo() { |
| 32 UndoManager *undo_manager = GetUndoManager(profile_); | 32 UndoManager *undo_manager = GetUndoManager(profile_); |
| 33 if (undo_manager) | 33 if (undo_manager) |
| 34 undo_manager->ResumeUndoTracking(); | 34 undo_manager->ResumeUndoTracking(); |
| 35 } | 35 } |
| 36 |
| 37 // ScopedGroupBookmarkActions ------------------------------------------------- |
| 38 |
| 39 ScopedGroupBookmarkActions::ScopedGroupBookmarkActions(Profile* profile) |
| 40 : profile_(profile) { |
| 41 UndoManager *undo_manager = GetUndoManager(profile_); |
| 42 if (undo_manager) |
| 43 undo_manager->StartGroupingActions(); |
| 44 } |
| 45 |
| 46 ScopedGroupBookmarkActions::~ScopedGroupBookmarkActions() { |
| 47 UndoManager *undo_manager = GetUndoManager(profile_); |
| 48 if (undo_manager) |
| 49 undo_manager->EndGroupingActions(); |
| 50 } |
| OLD | NEW |