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

Side by Side Diff: components/undo/undo_manager.cc

Issue 1090993003: Move undo files into //components/undo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@utils
Patch Set: Fix gn compilation Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « components/undo/undo_manager.h ('k') | components/undo/undo_manager_observer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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/undo_manager.h" 5 #include "components/undo/undo_manager.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "chrome/browser/undo/undo_manager_observer.h" 9 #include "components/undo/undo_manager_observer.h"
10 #include "chrome/browser/undo/undo_operation.h" 10 #include "components/undo/undo_operation.h"
11 #include "grit/components_strings.h" 11 #include "grit/components_strings.h"
12 #include "ui/base/l10n/l10n_util.h" 12 #include "ui/base/l10n/l10n_util.h"
13 13
14 namespace { 14 namespace {
15 15
16 // Maximum number of changes that can be undone. 16 // Maximum number of changes that can be undone.
17 const size_t kMaxUndoGroups = 100; 17 const size_t kMaxUndoGroups = 100;
18 18
19 } // namespace 19 } // namespace
20 20
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 // Limit the number of undo levels so the undo stack does not grow unbounded. 215 // Limit the number of undo levels so the undo stack does not grow unbounded.
216 if (GetActiveUndoGroup()->size() > kMaxUndoGroups) 216 if (GetActiveUndoGroup()->size() > kMaxUndoGroups)
217 GetActiveUndoGroup()->erase(GetActiveUndoGroup()->begin()); 217 GetActiveUndoGroup()->erase(GetActiveUndoGroup()->begin());
218 218
219 NotifyOnUndoManagerStateChange(); 219 NotifyOnUndoManagerStateChange();
220 } 220 }
221 221
222 ScopedVector<UndoGroup>* UndoManager::GetActiveUndoGroup() { 222 ScopedVector<UndoGroup>* UndoManager::GetActiveUndoGroup() {
223 return performing_undo_ ? &redo_actions_ : &undo_actions_; 223 return performing_undo_ ? &redo_actions_ : &undo_actions_;
224 } 224 }
OLDNEW
« no previous file with comments | « components/undo/undo_manager.h ('k') | components/undo/undo_manager_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698