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

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

Issue 2323983003: DO NOT SUBMIT: Bundle IME-related messages into one for batch edit (Closed)
Patch Set: fixed nits and fixed blimp test 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 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after
1214 { 1214 {
1215 TRACE_EVENT0("blink", "WebLocalFrameImpl::moveCaretSelection"); 1215 TRACE_EVENT0("blink", "WebLocalFrameImpl::moveCaretSelection");
1216 Element* editable = frame()->selection().rootEditableElement(); 1216 Element* editable = frame()->selection().rootEditableElement();
1217 if (!editable) 1217 if (!editable)
1218 return; 1218 return;
1219 1219
1220 VisiblePosition position = visiblePositionForViewportPoint(pointInViewport); 1220 VisiblePosition position = visiblePositionForViewportPoint(pointInViewport);
1221 frame()->selection().moveTo(position, UserTriggered); 1221 frame()->selection().moveTo(position, UserTriggered);
1222 } 1222 }
1223 1223
1224 bool WebLocalFrameImpl::setEditableSelectionOffsets(int start, int end)
1225 {
1226 TRACE_EVENT0("blink", "WebLocalFrameImpl::setEditableSelectionOffsets");
1227
1228 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
1229 // needs to be audited. See http://crbug.com/590369 for more details.
1230 frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets();
1231
1232 return frame()->inputMethodController().setEditableSelectionOffsets(PlainTex tRange(start, end));
1233 }
1234
1235 bool WebLocalFrameImpl::setCompositionFromExistingText(int compositionStart, int compositionEnd, const WebVector<WebCompositionUnderline>& underlines)
1236 {
1237 TRACE_EVENT0("blink", "WebLocalFrameImpl::setCompositionFromExistingText");
1238 if (!frame()->editor().canEdit())
1239 return false;
1240
1241 InputMethodController& inputMethodController = frame()->inputMethodControlle r();
1242 inputMethodController.cancelComposition();
1243
1244 if (compositionStart == compositionEnd)
1245 return true;
1246
1247 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
1248 // needs to be audited. See http://crbug.com/590369 for more details.
1249 frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets();
1250
1251 inputMethodController.setCompositionFromExistingText(CompositionUnderlineVec torBuilder(underlines), compositionStart, compositionEnd);
1252
1253 return true;
1254 }
1255
1256 void WebLocalFrameImpl::extendSelectionAndDelete(int before, int after)
1257 {
1258 TRACE_EVENT0("blink", "WebLocalFrameImpl::extendSelectionAndDelete");
1259 if (WebPlugin* plugin = focusedPluginIfInputMethodSupported()) {
1260 plugin->extendSelectionAndDelete(before, after);
1261 return;
1262 }
1263
1264 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
1265 // needs to be audited. See http://crbug.com/590369 for more details.
1266 frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets();
1267
1268 frame()->inputMethodController().extendSelectionAndDelete(before, after);
1269 }
1270
1271 void WebLocalFrameImpl::setCaretVisible(bool visible) 1224 void WebLocalFrameImpl::setCaretVisible(bool visible)
1272 { 1225 {
1273 frame()->selection().setCaretVisible(visible); 1226 frame()->selection().setCaretVisible(visible);
1274 } 1227 }
1275 1228
1276 VisiblePosition WebLocalFrameImpl::visiblePositionForViewportPoint(const WebPoin t& pointInViewport) 1229 VisiblePosition WebLocalFrameImpl::visiblePositionForViewportPoint(const WebPoin t& pointInViewport)
1277 { 1230 {
1278 return visiblePositionForContentsPoint(frame()->view()->viewportToContents(p ointInViewport), frame()); 1231 return visiblePositionForContentsPoint(frame()->view()->viewportToContents(p ointInViewport), frame());
1279 } 1232 }
1280 1233
(...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after
2235 feature = UseCounter::ChromeLoadTimesNpnNegotiatedProtocol; 2188 feature = UseCounter::ChromeLoadTimesNpnNegotiatedProtocol;
2236 } else if (metric == "wasAlternateProtocolAvailable") { 2189 } else if (metric == "wasAlternateProtocolAvailable") {
2237 feature = UseCounter::ChromeLoadTimesWasAlternateProtocolAvailable; 2190 feature = UseCounter::ChromeLoadTimesWasAlternateProtocolAvailable;
2238 } else if (metric == "connectionInfo") { 2191 } else if (metric == "connectionInfo") {
2239 feature = UseCounter::ChromeLoadTimesConnectionInfo; 2192 feature = UseCounter::ChromeLoadTimesConnectionInfo;
2240 } 2193 }
2241 UseCounter::count(frame(), feature); 2194 UseCounter::count(frame(), feature);
2242 } 2195 }
2243 2196
2244 } // namespace blink 2197 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebLocalFrameImpl.h ('k') | third_party/WebKit/Source/web/WebViewImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698