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

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

Issue 2675363003: [InputEvent] Fire "insertCompositionText" during IME (Closed)
Patch Set: Created 3 years, 10 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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 insertText(m_textToInsert, m_selectInsertedText, editingState); 460 insertText(m_textToInsert, m_selectInsertedText, editingState);
461 return; 461 return;
462 } 462 }
463 463
464 NOTREACHED(); 464 NOTREACHED();
465 } 465 }
466 466
467 InputEvent::InputType TypingCommand::inputType() const { 467 InputEvent::InputType TypingCommand::inputType() const {
468 using InputType = InputEvent::InputType; 468 using InputType = InputEvent::InputType;
469 469
470 if (m_compositionType != TextCompositionNone)
471 return InputType::InsertCompositionText;
472
470 switch (m_commandType) { 473 switch (m_commandType) {
471 // TODO(chongz): |DeleteSelection| is used by IME but we don't have 474 // TODO(chongz): |DeleteSelection| is used by IME but we don't have
472 // direction info. 475 // direction info.
473 case DeleteSelection: 476 case DeleteSelection:
474 return InputType::DeleteContentBackward; 477 return InputType::DeleteContentBackward;
475 case DeleteKey: 478 case DeleteKey:
476 if (m_compositionType != TextCompositionNone)
477 return InputType::DeleteComposedCharacterBackward;
478 return deletionInputTypeFromTextGranularity(DeleteDirection::Backward, 479 return deletionInputTypeFromTextGranularity(DeleteDirection::Backward,
479 m_granularity); 480 m_granularity);
480 case ForwardDeleteKey: 481 case ForwardDeleteKey:
481 if (m_compositionType != TextCompositionNone)
482 return InputType::DeleteComposedCharacterForward;
483 return deletionInputTypeFromTextGranularity(DeleteDirection::Forward, 482 return deletionInputTypeFromTextGranularity(DeleteDirection::Forward,
484 m_granularity); 483 m_granularity);
485 case InsertText: 484 case InsertText:
486 return InputType::InsertText; 485 return InputType::InsertText;
487 case InsertLineBreak: 486 case InsertLineBreak:
488 return InputType::InsertLineBreak; 487 return InputType::InsertLineBreak;
489 case InsertParagraphSeparator: 488 case InsertParagraphSeparator:
490 case InsertParagraphSeparatorInQuotedContent: 489 case InsertParagraphSeparatorInQuotedContent:
491 return InputType::InsertParagraph; 490 return InputType::InsertParagraph;
492 default: 491 default:
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 } 956 }
958 NOTREACHED(); 957 NOTREACHED();
959 m_preservesTypingStyle = false; 958 m_preservesTypingStyle = false;
960 } 959 }
961 960
962 bool TypingCommand::isTypingCommand() const { 961 bool TypingCommand::isTypingCommand() const {
963 return true; 962 return true;
964 } 963 }
965 964
966 } // namespace blink 965 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698