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

Side by Side Diff: third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp

Issue 2664603002: Remove replaceComposition() calls in finishComposingText. (Closed)
Patch Set: Rebase 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) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 SelectionInDOMTree::Builder().collapse(position).build()); 465 SelectionInDOMTree::Builder().collapse(position).build());
466 } 466 }
467 } 467 }
468 } 468 }
469 m_imeAcceptEvents = true; 469 m_imeAcceptEvents = true;
470 } else { 470 } else {
471 LocalFrame* focusedFrame = focusedLocalFrameInWidget(); 471 LocalFrame* focusedFrame = focusedLocalFrameInWidget();
472 if (focusedFrame) { 472 if (focusedFrame) {
473 // Finish an ongoing composition to delete the composition node. 473 // Finish an ongoing composition to delete the composition node.
474 if (focusedFrame->inputMethodController().hasComposition()) { 474 if (focusedFrame->inputMethodController().hasComposition()) {
475 WebAutofillClient* autofillClient =
476 WebLocalFrameImpl::fromFrame(focusedFrame)->autofillClient();
477
478 if (autofillClient)
479 autofillClient->setIgnoreTextChanges(true);
480
481 // TODO(xiaochengh): The use of 475 // TODO(xiaochengh): The use of
482 // updateStyleAndLayoutIgnorePendingStylesheets needs to be audited. 476 // updateStyleAndLayoutIgnorePendingStylesheets needs to be audited.
483 // See http://crbug.com/590369 for more details. 477 // See http://crbug.com/590369 for more details.
484 focusedFrame->document() 478 focusedFrame->document()
485 ->updateStyleAndLayoutIgnorePendingStylesheets(); 479 ->updateStyleAndLayoutIgnorePendingStylesheets();
486 480
487 focusedFrame->inputMethodController().finishComposingText( 481 focusedFrame->inputMethodController().finishComposingText(
488 InputMethodController::KeepSelection); 482 InputMethodController::KeepSelection);
489
490 if (autofillClient)
491 autofillClient->setIgnoreTextChanges(false);
492 } 483 }
493 m_imeAcceptEvents = false; 484 m_imeAcceptEvents = false;
494 } 485 }
495 } 486 }
496 } 487 }
497 488
498 // TODO(ekaramad):This method is almost duplicated in WebViewImpl as well. This 489 // TODO(ekaramad):This method is almost duplicated in WebViewImpl as well. This
499 // code needs to be refactored (http://crbug.com/629721). 490 // code needs to be refactored (http://crbug.com/629721).
500 WebRange WebFrameWidgetImpl::compositionRange() { 491 WebRange WebFrameWidgetImpl::compositionRange() {
501 LocalFrame* focused = focusedLocalFrameAvailableForIme(); 492 LocalFrame* focused = focusedLocalFrameAvailableForIme();
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after
1141 return nullptr; 1132 return nullptr;
1142 } 1133 }
1143 1134
1144 LocalFrame* WebFrameWidgetImpl::focusedLocalFrameAvailableForIme() const { 1135 LocalFrame* WebFrameWidgetImpl::focusedLocalFrameAvailableForIme() const {
1145 if (!m_imeAcceptEvents) 1136 if (!m_imeAcceptEvents)
1146 return nullptr; 1137 return nullptr;
1147 return focusedLocalFrameInWidget(); 1138 return focusedLocalFrameInWidget();
1148 } 1139 }
1149 1140
1150 } // namespace blink 1141 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp ('k') | third_party/WebKit/Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698