| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 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 2280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2291 m_page->mainFrame() && m_page->mainFrame()->isLocalFrame() | 2291 m_page->mainFrame() && m_page->mainFrame()->isLocalFrame() |
| 2292 ? m_page->deprecatedLocalMainFrame() | 2292 ? m_page->deprecatedLocalMainFrame() |
| 2293 : nullptr; | 2293 : nullptr; |
| 2294 if (!frame) | 2294 if (!frame) |
| 2295 return; | 2295 return; |
| 2296 | 2296 |
| 2297 LocalFrame* focusedFrame = focusedLocalFrameInWidget(); | 2297 LocalFrame* focusedFrame = focusedLocalFrameInWidget(); |
| 2298 if (focusedFrame) { | 2298 if (focusedFrame) { |
| 2299 // Finish an ongoing composition to delete the composition node. | 2299 // Finish an ongoing composition to delete the composition node. |
| 2300 if (focusedFrame->inputMethodController().hasComposition()) { | 2300 if (focusedFrame->inputMethodController().hasComposition()) { |
| 2301 WebAutofillClient* autofillClient = | |
| 2302 WebLocalFrameImpl::fromFrame(focusedFrame)->autofillClient(); | |
| 2303 | |
| 2304 if (autofillClient) | |
| 2305 autofillClient->setIgnoreTextChanges(true); | |
| 2306 | |
| 2307 // TODO(xiaochengh): The use of | 2301 // TODO(xiaochengh): The use of |
| 2308 // updateStyleAndLayoutIgnorePendingStylesheets | 2302 // updateStyleAndLayoutIgnorePendingStylesheets |
| 2309 // needs to be audited. See http://crbug.com/590369 for more details. | 2303 // needs to be audited. See http://crbug.com/590369 for more details. |
| 2310 focusedFrame->document() | 2304 focusedFrame->document() |
| 2311 ->updateStyleAndLayoutIgnorePendingStylesheets(); | 2305 ->updateStyleAndLayoutIgnorePendingStylesheets(); |
| 2312 | 2306 |
| 2313 focusedFrame->inputMethodController().finishComposingText( | 2307 focusedFrame->inputMethodController().finishComposingText( |
| 2314 InputMethodController::KeepSelection); | 2308 InputMethodController::KeepSelection); |
| 2315 | |
| 2316 if (autofillClient) | |
| 2317 autofillClient->setIgnoreTextChanges(false); | |
| 2318 } | 2309 } |
| 2319 m_imeAcceptEvents = false; | 2310 m_imeAcceptEvents = false; |
| 2320 } | 2311 } |
| 2321 } | 2312 } |
| 2322 } | 2313 } |
| 2323 | 2314 |
| 2324 // TODO(ekaramad):This method is almost duplicated in WebFrameWidgetImpl as | 2315 // TODO(ekaramad):This method is almost duplicated in WebFrameWidgetImpl as |
| 2325 // well. This code needs to be refactored (http://crbug.com/629721). | 2316 // well. This code needs to be refactored (http://crbug.com/629721). |
| 2326 WebRange WebViewImpl::compositionRange() { | 2317 WebRange WebViewImpl::compositionRange() { |
| 2327 LocalFrame* focused = focusedLocalFrameAvailableForIme(); | 2318 LocalFrame* focused = focusedLocalFrameAvailableForIme(); |
| (...skipping 1866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4194 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) | 4185 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) |
| 4195 return nullptr; | 4186 return nullptr; |
| 4196 return focusedFrame; | 4187 return focusedFrame; |
| 4197 } | 4188 } |
| 4198 | 4189 |
| 4199 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { | 4190 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { |
| 4200 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; | 4191 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; |
| 4201 } | 4192 } |
| 4202 | 4193 |
| 4203 } // namespace blink | 4194 } // namespace blink |
| OLD | NEW |