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

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

Issue 2117543003: [InputEvent] Fill |data| field for 'input' event InsertText (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed |dataFromCommand()| helper function 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 25 matching lines...) Expand all
36 RebalanceLeadingAndTrailingWhitespaces, 36 RebalanceLeadingAndTrailingWhitespaces,
37 RebalanceAllWhitespaces 37 RebalanceAllWhitespaces
38 }; 38 };
39 39
40 static InsertTextCommand* create(Document& document, const String& text, boo l selectInsertedText = false, 40 static InsertTextCommand* create(Document& document, const String& text, boo l selectInsertedText = false,
41 RebalanceType rebalanceType = RebalanceLeadingAndTrailingWhitespaces) 41 RebalanceType rebalanceType = RebalanceLeadingAndTrailingWhitespaces)
42 { 42 {
43 return new InsertTextCommand(document, text, selectInsertedText, rebalan ceType); 43 return new InsertTextCommand(document, text, selectInsertedText, rebalan ceType);
44 } 44 }
45 45
46 String textDataForInputEvent() const final;
47
46 private: 48 private:
47 InsertTextCommand(Document&, const String& text, bool selectInsertedText, Re balanceType); 49 InsertTextCommand(Document&, const String& text, bool selectInsertedText, Re balanceType);
48 50
49 void doApply(EditingState*) override; 51 void doApply(EditingState*) override;
50 52
51 Position positionInsideTextNode(const Position&, EditingState*); 53 Position positionInsideTextNode(const Position&, EditingState*);
52 Position insertTab(const Position&, EditingState*); 54 Position insertTab(const Position&, EditingState*);
53 55
54 bool performTrivialReplace(const String&, bool selectInsertedText); 56 bool performTrivialReplace(const String&, bool selectInsertedText);
55 bool performOverwrite(const String&, bool selectInsertedText); 57 bool performOverwrite(const String&, bool selectInsertedText);
56 void setEndingSelectionWithoutValidation(const Position& startPosition, cons t Position& endPosition); 58 void setEndingSelectionWithoutValidation(const Position& startPosition, cons t Position& endPosition);
57 59
58 friend class TypingCommand; 60 friend class TypingCommand;
59 61
60 String m_text; 62 String m_text;
61 bool m_selectInsertedText; 63 bool m_selectInsertedText;
62 RebalanceType m_rebalanceType; 64 RebalanceType m_rebalanceType;
63 }; 65 };
64 66
65 } // namespace blink 67 } // namespace blink
66 68
67 #endif // InsertTextCommand_h 69 #endif // InsertTextCommand_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698