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

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

Issue 2720193002: Implement hot mode invocation for idle time spell checker (Closed)
Patch Set: Wed Mar 1 16:02:57 PST 2017 Created 3 years, 9 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, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2007, 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 const String&, 75 const String&,
76 const VisibleSelection&, 76 const VisibleSelection&,
77 Options, 77 Options,
78 TextCompositionType = TextCompositionNone, 78 TextCompositionType = TextCompositionNone,
79 const bool isIncrementalInsertion = false); 79 const bool isIncrementalInsertion = false);
80 static bool insertLineBreak(Document&); 80 static bool insertLineBreak(Document&);
81 static bool insertParagraphSeparator(Document&); 81 static bool insertParagraphSeparator(Document&);
82 static bool insertParagraphSeparatorInQuotedContent(Document&); 82 static bool insertParagraphSeparatorInQuotedContent(Document&);
83 static void closeTyping(LocalFrame*); 83 static void closeTyping(LocalFrame*);
84 84
85 static TypingCommand* lastTypingCommandIfStillOpenForTyping(LocalFrame*);
yosin_UTC9 2017/03/02 03:38:40 It seems we want to move this function to |Editor|
Xiaocheng 2017/03/02 04:34:59 Hmm, agreed that Editor is a better place for this
86
85 void insertText(const String& text, bool selectInsertedText, EditingState*); 87 void insertText(const String& text, bool selectInsertedText, EditingState*);
86 void insertTextRunWithoutNewlines(const String& text, 88 void insertTextRunWithoutNewlines(const String& text,
87 bool selectInsertedText, 89 bool selectInsertedText,
88 EditingState*); 90 EditingState*);
89 void insertLineBreak(EditingState*); 91 void insertLineBreak(EditingState*);
90 void insertParagraphSeparatorInQuotedContent(EditingState*); 92 void insertParagraphSeparatorInQuotedContent(EditingState*);
91 void insertParagraphSeparator(EditingState*); 93 void insertParagraphSeparator(EditingState*);
92 void deleteKeyPressed(TextGranularity, bool killRing, EditingState*); 94 void deleteKeyPressed(TextGranularity, bool killRing, EditingState*);
93 void forwardDeleteKeyPressed(TextGranularity, bool killRing, EditingState*); 95 void forwardDeleteKeyPressed(TextGranularity, bool killRing, EditingState*);
94 void deleteSelection(bool smartDelete, EditingState*); 96 void deleteSelection(bool smartDelete, EditingState*);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 ETypingCommand, 130 ETypingCommand,
129 const String& text, 131 const String& text,
130 Options, 132 Options,
131 TextGranularity, 133 TextGranularity,
132 TextCompositionType); 134 TextCompositionType);
133 135
134 void setSmartDelete(bool smartDelete) { m_smartDelete = smartDelete; } 136 void setSmartDelete(bool smartDelete) { m_smartDelete = smartDelete; }
135 bool isOpenForMoreTyping() const { return m_openForMoreTyping; } 137 bool isOpenForMoreTyping() const { return m_openForMoreTyping; }
136 void closeTyping() { m_openForMoreTyping = false; } 138 void closeTyping() { m_openForMoreTyping = false; }
137 139
138 static TypingCommand* lastTypingCommandIfStillOpenForTyping(LocalFrame*);
139
140 void doApply(EditingState*) override; 140 void doApply(EditingState*) override;
141 InputEvent::InputType inputType() const override; 141 InputEvent::InputType inputType() const override;
142 bool isTypingCommand() const override; 142 bool isTypingCommand() const override;
143 bool preservesTypingStyle() const override { return m_preservesTypingStyle; } 143 bool preservesTypingStyle() const override { return m_preservesTypingStyle; }
144 void setShouldRetainAutocorrectionIndicator(bool retain) override { 144 void setShouldRetainAutocorrectionIndicator(bool retain) override {
145 m_shouldRetainAutocorrectionIndicator = retain; 145 m_shouldRetainAutocorrectionIndicator = retain;
146 } 146 }
147 bool shouldStopCaretBlinking() const override { return true; } 147 bool shouldStopCaretBlinking() const override { return true; }
148 void setShouldPreventSpellChecking(bool prevent) { 148 void setShouldPreventSpellChecking(bool prevent) {
149 m_shouldPreventSpellChecking = prevent; 149 m_shouldPreventSpellChecking = prevent;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 186
187 DEFINE_TYPE_CASTS(TypingCommand, 187 DEFINE_TYPE_CASTS(TypingCommand,
188 CompositeEditCommand, 188 CompositeEditCommand,
189 command, 189 command,
190 command->isTypingCommand(), 190 command->isTypingCommand(),
191 command.isTypingCommand()); 191 command.isTypingCommand());
192 192
193 } // namespace blink 193 } // namespace blink
194 194
195 #endif // TypingCommand_h 195 #endif // TypingCommand_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698