Home | History | Annotate | Download | only in undo
      1 // Copyright 2013 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/undo_manager_utils.h"
      6 
      7 #include "chrome/browser/undo/undo_manager.h"
      8 
      9 // ScopedSuspendUndoTracking --------------------------------------------------
     10 
     11 ScopedSuspendUndoTracking::ScopedSuspendUndoTracking(UndoManager* undo_manager)
     12     : undo_manager_(undo_manager) {
     13   undo_manager_->SuspendUndoTracking();
     14 }
     15 
     16 ScopedSuspendUndoTracking::~ScopedSuspendUndoTracking() {
     17   undo_manager_->ResumeUndoTracking();
     18 }
     19 
     20 // ScopedGroupingAction -------------------------------------------------------
     21 
     22 ScopedGroupingAction::ScopedGroupingAction(UndoManager* undo_manager)
     23     : undo_manager_(undo_manager) {
     24   undo_manager_->StartGroupingActions();
     25 }
     26 
     27 ScopedGroupingAction::~ScopedGroupingAction() {
     28   undo_manager_->EndGroupingActions();
     29 }
     30