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

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

Issue 2339793002: Handle newCursorPosition correctly for Android's commitText() (Closed)
Patch Set: Fix compile error (rebased on r418371) Created 4 years, 3 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) 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 929 matching lines...) Expand 10 before | Expand all | Expand 10 after
940 { 940 {
941 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets 941 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
942 // needs to be audited. See http://crbug.com/590369 for more details. 942 // needs to be audited. See http://crbug.com/590369 for more details.
943 frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets(); 943 frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets();
944 944
945 bool selectReplacement = frame()->editor().behavior().shouldSelectReplacemen t(); 945 bool selectReplacement = frame()->editor().behavior().shouldSelectReplacemen t();
946 bool smartReplace = true; 946 bool smartReplace = true;
947 frame()->editor().replaceSelectionWithText(text, selectReplacement, smartRep lace); 947 frame()->editor().replaceSelectionWithText(text, selectReplacement, smartRep lace);
948 } 948 }
949 949
950 void WebLocalFrameImpl::insertText(const WebString& text)
951 {
952 if (frame()->inputMethodController().hasComposition()) {
953 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesh eets
954 // needs to be audited. See http://crbug.com/590369 for more details.
955 frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets();
956
957 frame()->inputMethodController().confirmComposition(text);
958 } else {
959 frame()->editor().insertText(text, 0);
960 }
961 }
962
963 void WebLocalFrameImpl::setMarkedText(const WebString& text, unsigned location, unsigned length) 950 void WebLocalFrameImpl::setMarkedText(const WebString& text, unsigned location, unsigned length)
964 { 951 {
965 Vector<CompositionUnderline> decorations; 952 Vector<CompositionUnderline> decorations;
966 frame()->inputMethodController().setComposition(text, decorations, location, length); 953 frame()->inputMethodController().setComposition(text, decorations, location, length);
967 } 954 }
968 955
969 void WebLocalFrameImpl::unmarkText() 956 void WebLocalFrameImpl::unmarkText()
970 { 957 {
971 frame()->inputMethodController().cancelComposition(); 958 frame()->inputMethodController().cancelComposition();
972 } 959 }
(...skipping 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after
2248 feature = UseCounter::ChromeLoadTimesNpnNegotiatedProtocol; 2235 feature = UseCounter::ChromeLoadTimesNpnNegotiatedProtocol;
2249 } else if (metric == "wasAlternateProtocolAvailable") { 2236 } else if (metric == "wasAlternateProtocolAvailable") {
2250 feature = UseCounter::ChromeLoadTimesWasAlternateProtocolAvailable; 2237 feature = UseCounter::ChromeLoadTimesWasAlternateProtocolAvailable;
2251 } else if (metric == "connectionInfo") { 2238 } else if (metric == "connectionInfo") {
2252 feature = UseCounter::ChromeLoadTimesConnectionInfo; 2239 feature = UseCounter::ChromeLoadTimesConnectionInfo;
2253 } 2240 }
2254 UseCounter::count(frame(), feature); 2241 UseCounter::count(frame(), feature);
2255 } 2242 }
2256 2243
2257 } // namespace blink 2244 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebLocalFrameImpl.h ('k') | third_party/WebKit/Source/web/WebViewFrameWidget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698