| OLD | NEW |
| 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 Loading... |
| 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 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1136 return nullptr; | 1127 return nullptr; |
| 1137 } | 1128 } |
| 1138 | 1129 |
| 1139 LocalFrame* WebFrameWidgetImpl::focusedLocalFrameAvailableForIme() const { | 1130 LocalFrame* WebFrameWidgetImpl::focusedLocalFrameAvailableForIme() const { |
| 1140 if (!m_imeAcceptEvents) | 1131 if (!m_imeAcceptEvents) |
| 1141 return nullptr; | 1132 return nullptr; |
| 1142 return focusedLocalFrameInWidget(); | 1133 return focusedLocalFrameInWidget(); |
| 1143 } | 1134 } |
| 1144 | 1135 |
| 1145 } // namespace blink | 1136 } // namespace blink |
| OLD | NEW |