Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 SanitizeFragment = 1 << 5 | 45 SanitizeFragment = 1 << 5 |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 typedef unsigned CommandOptions; | 48 typedef unsigned CommandOptions; |
| 49 | 49 |
| 50 static PassRefPtrWillBeRawPtr<ReplaceSelectionCommand> create(Document& docu ment, PassRefPtrWillBeRawPtr<DocumentFragment> fragment, CommandOptions options, EditAction action = EditActionPaste) | 50 static PassRefPtrWillBeRawPtr<ReplaceSelectionCommand> create(Document& docu ment, PassRefPtrWillBeRawPtr<DocumentFragment> fragment, CommandOptions options, EditAction action = EditActionPaste) |
| 51 { | 51 { |
| 52 return adoptRefWillBeNoop(new ReplaceSelectionCommand(document, fragment , options, action)); | 52 return adoptRefWillBeNoop(new ReplaceSelectionCommand(document, fragment , options, action)); |
| 53 } | 53 } |
| 54 | 54 |
| 55 EphemeralRange insertedRange() { return EphemeralRange(m_startOfInsertedRang e, m_endOfInsertedRange); } | |
|
yosin_UTC9
2016/01/22 09:56:55
nit: This member function should be marked with |c
Xiaocheng
2016/01/22 10:24:37
Done.
| |
| 56 | |
| 55 DECLARE_VIRTUAL_TRACE(); | 57 DECLARE_VIRTUAL_TRACE(); |
| 56 | 58 |
| 57 private: | 59 private: |
| 58 ReplaceSelectionCommand(Document&, PassRefPtrWillBeRawPtr<DocumentFragment>, CommandOptions, EditAction); | 60 ReplaceSelectionCommand(Document&, PassRefPtrWillBeRawPtr<DocumentFragment>, CommandOptions, EditAction); |
| 59 | 61 |
| 60 void doApply() override; | 62 void doApply() override; |
| 61 EditAction editingAction() const override; | 63 EditAction editingAction() const override; |
| 62 bool isReplaceSelectionCommand() const override; | 64 bool isReplaceSelectionCommand() const override; |
| 63 | 65 |
| 64 class InsertedNodes { | 66 class InsertedNodes { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 RefPtrWillBeMember<EditingStyle> m_insertionStyle; | 113 RefPtrWillBeMember<EditingStyle> m_insertionStyle; |
| 112 bool m_selectReplacement; | 114 bool m_selectReplacement; |
| 113 bool m_smartReplace; | 115 bool m_smartReplace; |
| 114 bool m_matchStyle; | 116 bool m_matchStyle; |
| 115 RefPtrWillBeMember<DocumentFragment> m_documentFragment; | 117 RefPtrWillBeMember<DocumentFragment> m_documentFragment; |
| 116 bool m_preventNesting; | 118 bool m_preventNesting; |
| 117 bool m_movingParagraph; | 119 bool m_movingParagraph; |
| 118 EditAction m_editAction; | 120 EditAction m_editAction; |
| 119 bool m_sanitizeFragment; | 121 bool m_sanitizeFragment; |
| 120 bool m_shouldMergeEnd; | 122 bool m_shouldMergeEnd; |
| 123 | |
| 124 Position m_startOfInsertedRange; | |
| 125 Position m_endOfInsertedRange; | |
| 121 }; | 126 }; |
| 122 | 127 |
| 123 DEFINE_TYPE_CASTS(ReplaceSelectionCommand, CompositeEditCommand, command, comman d->isReplaceSelectionCommand(), command.isReplaceSelectionCommand()); | 128 DEFINE_TYPE_CASTS(ReplaceSelectionCommand, CompositeEditCommand, command, comman d->isReplaceSelectionCommand(), command.isReplaceSelectionCommand()); |
| 124 | 129 |
| 125 } // namespace blink | 130 } // namespace blink |
| 126 | 131 |
| 127 #endif // ReplaceSelectionCommand_h | 132 #endif // ReplaceSelectionCommand_h |
| OLD | NEW |