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

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

Issue 2681023003: Remove replaceComposition() calls in finishComposingText. (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) 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 2279 matching lines...) Expand 10 before | Expand all | Expand 10 after
2290 m_page->mainFrame() && m_page->mainFrame()->isLocalFrame() 2290 m_page->mainFrame() && m_page->mainFrame()->isLocalFrame()
2291 ? m_page->deprecatedLocalMainFrame() 2291 ? m_page->deprecatedLocalMainFrame()
2292 : nullptr; 2292 : nullptr;
2293 if (!frame) 2293 if (!frame)
2294 return; 2294 return;
2295 2295
2296 LocalFrame* focusedFrame = focusedLocalFrameInWidget(); 2296 LocalFrame* focusedFrame = focusedLocalFrameInWidget();
2297 if (focusedFrame) { 2297 if (focusedFrame) {
2298 // Finish an ongoing composition to delete the composition node. 2298 // Finish an ongoing composition to delete the composition node.
2299 if (focusedFrame->inputMethodController().hasComposition()) { 2299 if (focusedFrame->inputMethodController().hasComposition()) {
2300 WebAutofillClient* autofillClient =
2301 WebLocalFrameImpl::fromFrame(focusedFrame)->autofillClient();
2302
2303 if (autofillClient)
2304 autofillClient->setIgnoreTextChanges(true);
2305
2306 // TODO(xiaochengh): The use of 2300 // TODO(xiaochengh): The use of
2307 // updateStyleAndLayoutIgnorePendingStylesheets 2301 // updateStyleAndLayoutIgnorePendingStylesheets
2308 // needs to be audited. See http://crbug.com/590369 for more details. 2302 // needs to be audited. See http://crbug.com/590369 for more details.
2309 focusedFrame->document() 2303 focusedFrame->document()
2310 ->updateStyleAndLayoutIgnorePendingStylesheets(); 2304 ->updateStyleAndLayoutIgnorePendingStylesheets();
2311 2305
2312 focusedFrame->inputMethodController().finishComposingText( 2306 focusedFrame->inputMethodController().finishComposingText(
2313 InputMethodController::KeepSelection); 2307 InputMethodController::KeepSelection);
2314
2315 if (autofillClient)
2316 autofillClient->setIgnoreTextChanges(false);
2317 } 2308 }
2318 m_imeAcceptEvents = false; 2309 m_imeAcceptEvents = false;
2319 } 2310 }
2320 } 2311 }
2321 } 2312 }
2322 2313
2323 // TODO(ekaramad):This method is almost duplicated in WebFrameWidgetImpl as 2314 // TODO(ekaramad):This method is almost duplicated in WebFrameWidgetImpl as
2324 // well. This code needs to be refactored (http://crbug.com/629721). 2315 // well. This code needs to be refactored (http://crbug.com/629721).
2325 WebRange WebViewImpl::compositionRange() { 2316 WebRange WebViewImpl::compositionRange() {
2326 LocalFrame* focused = focusedLocalFrameAvailableForIme(); 2317 LocalFrame* focused = focusedLocalFrameAvailableForIme();
(...skipping 1864 matching lines...) Expand 10 before | Expand all | Expand 10 after
4191 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) 4182 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame())
4192 return nullptr; 4183 return nullptr;
4193 return focusedFrame; 4184 return focusedFrame;
4194 } 4185 }
4195 4186
4196 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { 4187 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const {
4197 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; 4188 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr;
4198 } 4189 }
4199 4190
4200 } // namespace blink 4191 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp ('k') | third_party/WebKit/Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698