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

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

Issue 2457523003: Support 'insertReplacementText' for spellcheck (Closed)
Patch Set: fix for chongz's nit Created 4 years, 1 month 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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 956 matching lines...) Expand 10 before | Expand all | Expand 10 after
967 } 967 }
968 968
969 void WebLocalFrameImpl::replaceSelection(const WebString& text) { 969 void WebLocalFrameImpl::replaceSelection(const WebString& text) {
970 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets 970 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
971 // needs to be audited. See http://crbug.com/590369 for more details. 971 // needs to be audited. See http://crbug.com/590369 for more details.
972 frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets(); 972 frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets();
973 973
974 bool selectReplacement = 974 bool selectReplacement =
975 frame()->editor().behavior().shouldSelectReplacement(); 975 frame()->editor().behavior().shouldSelectReplacement();
976 bool smartReplace = true; 976 bool smartReplace = true;
977 frame()->editor().replaceSelectionWithText(text, selectReplacement, 977 frame()->editor().replaceSelectionWithText(
978 smartReplace); 978 text, selectReplacement, smartReplace,
979 InputEvent::InputType::InsertReplacementText);
979 } 980 }
980 981
981 void WebLocalFrameImpl::setMarkedText(const WebString& text, 982 void WebLocalFrameImpl::setMarkedText(const WebString& text,
982 unsigned location, 983 unsigned location,
983 unsigned length) { 984 unsigned length) {
984 Vector<CompositionUnderline> decorations; 985 Vector<CompositionUnderline> decorations;
985 frame()->inputMethodController().setComposition(text, decorations, location, 986 frame()->inputMethodController().setComposition(text, decorations, location,
986 length); 987 length);
987 } 988 }
988 989
(...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after
2392 feature = UseCounter::ChromeLoadTimesNpnNegotiatedProtocol; 2393 feature = UseCounter::ChromeLoadTimesNpnNegotiatedProtocol;
2393 } else if (metric == "wasAlternateProtocolAvailable") { 2394 } else if (metric == "wasAlternateProtocolAvailable") {
2394 feature = UseCounter::ChromeLoadTimesWasAlternateProtocolAvailable; 2395 feature = UseCounter::ChromeLoadTimesWasAlternateProtocolAvailable;
2395 } else if (metric == "connectionInfo") { 2396 } else if (metric == "connectionInfo") {
2396 feature = UseCounter::ChromeLoadTimesConnectionInfo; 2397 feature = UseCounter::ChromeLoadTimesConnectionInfo;
2397 } 2398 }
2398 UseCounter::count(frame(), feature); 2399 UseCounter::count(frame(), feature);
2399 } 2400 }
2400 2401
2401 } // namespace blink 2402 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698