Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 48 public: | 48 public: |
| 49 static UndoStack* create(); | 49 static UndoStack* create(); |
| 50 | 50 |
| 51 void registerUndoStep(UndoStep*); | 51 void registerUndoStep(UndoStep*); |
| 52 void registerRedoStep(UndoStep*); | 52 void registerRedoStep(UndoStep*); |
| 53 bool canUndo() const; | 53 bool canUndo() const; |
| 54 bool canRedo() const; | 54 bool canRedo() const; |
| 55 void undo(); | 55 void undo(); |
| 56 void redo(); | 56 void redo(); |
| 57 void clear(); | 57 void clear(); |
| 58 int maxSequence() const { return m_maxSequence; } | |
| 58 | 59 |
| 59 DECLARE_TRACE(); | 60 DECLARE_TRACE(); |
| 60 | 61 |
| 61 private: | 62 private: |
| 62 UndoStack(); | 63 UndoStack(); |
| 63 | 64 |
| 64 typedef HeapDeque<Member<UndoStep>> UndoStepStack; | 65 typedef HeapDeque<Member<UndoStep>> UndoStepStack; |
| 65 | 66 |
| 67 int m_maxSequence; | |
|
yosin_UTC9
2017/01/17 08:13:29
Should we use |uint64_t| or |size_t|? But, I'm not
Xiaocheng
2017/01/17 09:04:02
No special rationale, just an arbitrary choice.
L
| |
| 66 bool m_inRedo; | 68 bool m_inRedo; |
| 67 UndoStepStack m_undoStack; | 69 UndoStepStack m_undoStack; |
| 68 UndoStepStack m_redoStack; | 70 UndoStepStack m_redoStack; |
| 69 }; | 71 }; |
| 70 | 72 |
| 71 } // namespace blink | 73 } // namespace blink |
| 72 | 74 |
| 73 #endif | 75 #endif |
| OLD | NEW |