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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 47 const VisibleSelection& startingSelection() const { return m_startingSelecti on; } | 47 const VisibleSelection& startingSelection() const { return m_startingSelecti on; } |
| 48 const VisibleSelection& endingSelection() const { return m_endingSelection; } | 48 const VisibleSelection& endingSelection() const { return m_endingSelection; } |
| 49 | 49 |
| 50 virtual bool isSimpleEditCommand() const { return false; } | 50 virtual bool isSimpleEditCommand() const { return false; } |
| 51 virtual bool isCompositeEditCommand() const { return false; } | 51 virtual bool isCompositeEditCommand() const { return false; } |
| 52 bool isTopLevelCommand() const { return !m_parent; } | 52 bool isTopLevelCommand() const { return !m_parent; } |
| 53 | 53 |
| 54 // The |EditingState*| argument must not be nullptr. | 54 // The |EditingState*| argument must not be nullptr. |
| 55 virtual void doApply(EditingState*) = 0; | 55 virtual void doApply(EditingState*) = 0; |
| 56 | 56 |
| 57 // |TypingCommand| will return |textData()| of the last |m_commands|. | |
| 58 virtual String textData() const { return emptyString(); } | |
|
yosin_UTC9
2016/07/06 01:20:55
Please move implementation of virtual member funct
chongz
2016/07/06 23:34:32
Done.
| |
| 59 | |
| 57 DECLARE_VIRTUAL_TRACE(); | 60 DECLARE_VIRTUAL_TRACE(); |
| 58 | 61 |
| 59 protected: | 62 protected: |
| 60 explicit EditCommand(Document&); | 63 explicit EditCommand(Document&); |
| 61 | 64 |
| 62 Document& document() const { return *m_document.get(); } | 65 Document& document() const { return *m_document.get(); } |
| 63 CompositeEditCommand* parent() const { return m_parent; } | 66 CompositeEditCommand* parent() const { return m_parent; } |
| 64 void setStartingSelection(const VisibleSelection&); | 67 void setStartingSelection(const VisibleSelection&); |
| 65 void setEndingSelection(const VisibleSelection&); | 68 void setEndingSelection(const VisibleSelection&); |
| 66 void setEndingSelection(const VisiblePosition&); | 69 void setEndingSelection(const VisiblePosition&); |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 92 | 95 |
| 93 private: | 96 private: |
| 94 bool isSimpleEditCommand() const final { return true; } | 97 bool isSimpleEditCommand() const final { return true; } |
| 95 }; | 98 }; |
| 96 | 99 |
| 97 DEFINE_TYPE_CASTS(SimpleEditCommand, EditCommand, command, command->isSimpleEdit Command(), command.isSimpleEditCommand()); | 100 DEFINE_TYPE_CASTS(SimpleEditCommand, EditCommand, command, command->isSimpleEdit Command(), command.isSimpleEditCommand()); |
| 98 | 101 |
| 99 } // namespace blink | 102 } // namespace blink |
| 100 | 103 |
| 101 #endif // EditCommand_h | 104 #endif // EditCommand_h |
| OLD | NEW |