summaryrefslogtreecommitdiffstats
path: root/chrome/browser/undo/undo_manager_utils.h
blob: b99817a1caaab4c697e8e6466f2b59530d0c1b15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_UNDO_UNDO_MANAGER_UTILS_H_
#define CHROME_BROWSER_UNDO_UNDO_MANAGER_UTILS_H_

#include "base/basictypes.h"

class UndoManager;

// ScopedSuspendUndoTracking ---------------------------------------------------

// Scopes the suspension of the undo tracking for non-user initiated changes
// such as those occuring during profile synchronization.
class ScopedSuspendUndoTracking {
 public:
  explicit ScopedSuspendUndoTracking(UndoManager* undo_manager);
  ~ScopedSuspendUndoTracking();

 private:
  UndoManager* undo_manager_;

  DISALLOW_COPY_AND_ASSIGN(ScopedSuspendUndoTracking);
};

// ScopedGroupingAction --------------------------------------------------------

// Scopes the grouping of a set of changes into one undoable action.
class ScopedGroupingAction {
 public:
  explicit ScopedGroupingAction(UndoManager* undo_manager);
  ~ScopedGroupingAction();

 private:
  UndoManager* undo_manager_;

  DISALLOW_COPY_AND_ASSIGN(ScopedGroupingAction);
};

#endif  // CHROME_BROWSER_UNDO_UNDO_MANAGER_UTILS_H_