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

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

Issue 2664603002: Remove replaceComposition() calls in finishComposingText. (Closed)
Patch Set: Clean up 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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 SelectionInDOMTree::Builder().collapse(position).build()); 464 SelectionInDOMTree::Builder().collapse(position).build());
465 } 465 }
466 } 466 }
467 } 467 }
468 m_imeAcceptEvents = true; 468 m_imeAcceptEvents = true;
469 } else { 469 } else {
470 LocalFrame* focusedFrame = focusedLocalFrameInWidget(); 470 LocalFrame* focusedFrame = focusedLocalFrameInWidget();
471 if (focusedFrame) { 471 if (focusedFrame) {
472 // Finish an ongoing composition to delete the composition node. 472 // Finish an ongoing composition to delete the composition node.
473 if (focusedFrame->inputMethodController().hasComposition()) { 473 if (focusedFrame->inputMethodController().hasComposition()) {
474 WebAutofillClient* autofillClient =
475 WebLocalFrameImpl::fromFrame(focusedFrame)->autofillClient();
476
477 if (autofillClient)
478 autofillClient->setIgnoreTextChanges(true);
479
480 // TODO(xiaochengh): The use of 474 // TODO(xiaochengh): The use of
481 // updateStyleAndLayoutIgnorePendingStylesheets needs to be audited. 475 // updateStyleAndLayoutIgnorePendingStylesheets needs to be audited.
482 // See http://crbug.com/590369 for more details. 476 // See http://crbug.com/590369 for more details.
483 focusedFrame->document() 477 focusedFrame->document()
484 ->updateStyleAndLayoutIgnorePendingStylesheets(); 478 ->updateStyleAndLayoutIgnorePendingStylesheets();
485 479
486 focusedFrame->inputMethodController().finishComposingText( 480 focusedFrame->inputMethodController().finishComposingText(
487 InputMethodController::KeepSelection); 481 InputMethodController::KeepSelection);
488
489 if (autofillClient)
490 autofillClient->setIgnoreTextChanges(false);
491 } 482 }
492 m_imeAcceptEvents = false; 483 m_imeAcceptEvents = false;
493 } 484 }
494 } 485 }
495 } 486 }
496 487
497 // TODO(ekaramad):This method is almost duplicated in WebViewImpl as well. This 488 // TODO(ekaramad):This method is almost duplicated in WebViewImpl as well. This
498 // code needs to be refactored (http://crbug.com/629721). 489 // code needs to be refactored (http://crbug.com/629721).
499 WebRange WebFrameWidgetImpl::compositionRange() { 490 WebRange WebFrameWidgetImpl::compositionRange() {
500 LocalFrame* focused = focusedLocalFrameAvailableForIme(); 491 LocalFrame* focused = focusedLocalFrameAvailableForIme();
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
1132 return nullptr; 1123 return nullptr;
1133 } 1124 }
1134 1125
1135 LocalFrame* WebFrameWidgetImpl::focusedLocalFrameAvailableForIme() const { 1126 LocalFrame* WebFrameWidgetImpl::focusedLocalFrameAvailableForIme() const {
1136 if (!m_imeAcceptEvents) 1127 if (!m_imeAcceptEvents)
1137 return nullptr; 1128 return nullptr;
1138 return focusedLocalFrameInWidget(); 1129 return focusedLocalFrameInWidget();
1139 } 1130 }
1140 1131
1141 } // namespace blink 1132 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698