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

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

Issue 2117543003: [InputEvent] Fill |data| field for 'input' event InsertText (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add virtual function |textData()| to |EditCommand| 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) 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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698