Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1374)

Unified Diff: chrome/browser/undo/undo_manager_utils.h

Issue 20571004: Helper classes to scope undo action. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/undo/undo_manager_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/undo/undo_manager_utils.h
diff --git a/chrome/browser/undo/undo_manager_utils.h b/chrome/browser/undo/undo_manager_utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..1290e821e97d82b10990f1155fbe0e3bc33d8fdc
--- /dev/null
+++ b/chrome/browser/undo/undo_manager_utils.h
@@ -0,0 +1,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_
« no previous file with comments | « no previous file | chrome/browser/undo/undo_manager_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698