Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007 Apple, Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007 Apple, Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Google, Inc. All rights reserved. | 3 * Copyright (C) 2012 Google, Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 114 RefPtr<UndoStep> step(*back); | 114 RefPtr<UndoStep> step(*back); |
| 115 m_redoStack.remove(back); | 115 m_redoStack.remove(back); |
| 116 | 116 |
| 117 ASSERT(!m_inRedo); | 117 ASSERT(!m_inRedo); |
| 118 TemporaryChange<bool> redoScope(m_inRedo, true); | 118 TemporaryChange<bool> redoScope(m_inRedo, true); |
| 119 step->reapply(); | 119 step->reapply(); |
| 120 // reapply will call us back to push this command onto the undo stack. | 120 // reapply will call us back to push this command onto the undo stack. |
| 121 } | 121 } |
| 122 } | 122 } |
| 123 | 123 |
| 124 void UndoStack::clear() | |
| 125 { | |
| 126 if (canUndo()) | |
|
eseidel
2014/03/04 02:08:16
Why check canUndo here?
| |
| 127 m_undoStack.clear(); | |
| 128 | |
| 129 if (canRedo()) | |
| 130 m_redoStack.clear(); | |
| 131 } | |
| 132 | |
| 124 } // namesace WebCore | 133 } // namesace WebCore |
| OLD | NEW |