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

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

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 | « chrome/browser/undo/undo_manager_utils.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/undo/undo_manager_utils.cc
diff --git a/chrome/browser/undo/undo_manager_utils.cc b/chrome/browser/undo/undo_manager_utils.cc
new file mode 100644
index 0000000000000000000000000000000000000000..59a79a23bb492c0d2e4f45fcd5f6a3f1782123cf
--- /dev/null
+++ b/chrome/browser/undo/undo_manager_utils.cc
@@ -0,0 +1,29 @@
+// 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.
+
+#include "chrome/browser/undo/undo_manager_utils.h"
+
+#include "chrome/browser/undo/undo_manager.h"
+
+// ScopedSuspendUndoTracking --------------------------------------------------
+
+ScopedSuspendUndoTracking::ScopedSuspendUndoTracking(UndoManager* undo_manager)
+ : undo_manager_(undo_manager) {
+ undo_manager_->SuspendUndoTracking();
+}
+
+ScopedSuspendUndoTracking::~ScopedSuspendUndoTracking() {
+ undo_manager_->ResumeUndoTracking();
+}
+
+// ScopedGroupingAction -------------------------------------------------------
+
+ScopedGroupingAction::ScopedGroupingAction(UndoManager* undo_manager)
+ : undo_manager_(undo_manager) {
+ undo_manager_->StartGroupingActions();
+}
+
+ScopedGroupingAction::~ScopedGroupingAction() {
+ undo_manager_->EndGroupingActions();
+}
« no previous file with comments | « chrome/browser/undo/undo_manager_utils.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698