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

Side by Side Diff: third_party/WebKit/Source/core/editing/commands/UndoStack.h

Issue 2110543008: Move UndoStack from Page to Editor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use |const Member| and add notes to UndoStack class Created 4 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 unified diff | Download patch
OLDNEW
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
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 // |UndoStack| is owned by and always 1:1 to |Editor|. Since |Editor| is 1:1 to
44 // |LocalFrame|, |UndoStack| is also 1:1 to |LocalFrame|.
43 class UndoStack final : public GarbageCollected<UndoStack> { 45 class UndoStack final : public GarbageCollected<UndoStack> {
44 WTF_MAKE_NONCOPYABLE(UndoStack); 46 WTF_MAKE_NONCOPYABLE(UndoStack);
45 public: 47 public:
46 static UndoStack* create(); 48 static UndoStack* create();
47 49
48 void registerUndoStep(UndoStep*); 50 void registerUndoStep(UndoStep*);
49 void registerRedoStep(UndoStep*); 51 void registerRedoStep(UndoStep*);
50 void didUnloadFrame(const LocalFrame&);
51 bool canUndo() const; 52 bool canUndo() const;
52 bool canRedo() const; 53 bool canRedo() const;
53 void undo(); 54 void undo();
54 void redo(); 55 void redo();
55 56
56 DECLARE_TRACE(); 57 DECLARE_TRACE();
57 58
58 private: 59 private:
59 UndoStack(); 60 UndoStack();
60 61
61 typedef HeapDeque<Member<UndoStep>> UndoStepStack; 62 typedef HeapDeque<Member<UndoStep>> UndoStepStack;
62 63
63 void filterOutUndoSteps(UndoStepStack&, const LocalFrame&);
64
65 bool m_inRedo; 64 bool m_inRedo;
66 UndoStepStack m_undoStack; 65 UndoStepStack m_undoStack;
67 UndoStepStack m_redoStack; 66 UndoStepStack m_redoStack;
68 }; 67 };
69 68
70 } // namespace blink 69 } // namespace blink
71 70
72 #endif 71 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/Editor.cpp ('k') | third_party/WebKit/Source/core/editing/commands/UndoStack.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698