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 22 matching lines...) Expand all Loading... | |
33 | 33 |
34 #include "platform/heap/Handle.h" | 34 #include "platform/heap/Handle.h" |
35 #include "wtf/Deque.h" | 35 #include "wtf/Deque.h" |
36 #include "wtf/Forward.h" | 36 #include "wtf/Forward.h" |
37 | 37 |
38 namespace blink { | 38 namespace blink { |
39 | 39 |
40 class LocalFrame; | 40 class LocalFrame; |
41 class UndoStep; | 41 class UndoStep; |
42 | 42 |
43 class UndoStack final : public GarbageCollected<UndoStack> { | 43 class UndoStack final : public GarbageCollected<UndoStack> { |
tkent
2016/07/04 07:44:36
Please add a comment that UndoStack is owned by Ed
Xiaocheng
2016/07/04 08:03:37
Done.
| |
44 WTF_MAKE_NONCOPYABLE(UndoStack); | 44 WTF_MAKE_NONCOPYABLE(UndoStack); |
45 public: | 45 public: |
46 static UndoStack* create(); | 46 static UndoStack* create(); |
47 | 47 |
48 void registerUndoStep(UndoStep*); | 48 void registerUndoStep(UndoStep*); |
49 void registerRedoStep(UndoStep*); | 49 void registerRedoStep(UndoStep*); |
50 void didUnloadFrame(const LocalFrame&); | |
51 bool canUndo() const; | 50 bool canUndo() const; |
52 bool canRedo() const; | 51 bool canRedo() const; |
53 void undo(); | 52 void undo(); |
54 void redo(); | 53 void redo(); |
55 | 54 |
56 DECLARE_TRACE(); | 55 DECLARE_TRACE(); |
57 | 56 |
58 private: | 57 private: |
59 UndoStack(); | 58 UndoStack(); |
60 | 59 |
61 typedef HeapDeque<Member<UndoStep>> UndoStepStack; | 60 typedef HeapDeque<Member<UndoStep>> UndoStepStack; |
62 | 61 |
63 void filterOutUndoSteps(UndoStepStack&, const LocalFrame&); | |
64 | |
65 bool m_inRedo; | 62 bool m_inRedo; |
66 UndoStepStack m_undoStack; | 63 UndoStepStack m_undoStack; |
67 UndoStepStack m_redoStack; | 64 UndoStepStack m_redoStack; |
68 }; | 65 }; |
69 | 66 |
70 } // namespace blink | 67 } // namespace blink |
71 | 68 |
72 #endif | 69 #endif |
OLD | NEW |