Chromium Code Reviews| Index: third_party/WebKit/Source/web/WebViewImpl.cpp |
| diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp |
| index fad565d27c6eaef57d89c1087056567fb40a7363..0764adbbb19fd135f4f754f83c8098dbc471253b 100644 |
| --- a/third_party/WebKit/Source/web/WebViewImpl.cpp |
| +++ b/third_party/WebKit/Source/web/WebViewImpl.cpp |
| @@ -2804,6 +2804,46 @@ void WebViewImpl::reportFixedRasterScaleUseCounters(bool hasBlurryContent, bool |
| UseCounter::count(document, UseCounter::FixedRasterScalePotentialPerformanceRegression); |
| } |
| +bool WebViewImpl::getCompositionCharacterBounds(WebVector<WebRect>& bounds) |
| +{ |
| + size_t offset = 0; |
| + size_t characterCount = 0; |
| + if (!compositionRange(&offset, &characterCount)) |
| + return false; |
| + |
| + if (characterCount == 0) |
| + return false; |
| + |
| + WebLocalFrame* frame = focusedFrame()->toWebLocalFrame(); |
| + |
| + if (frame->localRoot() != mainFrameImpl()) |
|
kenrb
2016/06/28 20:55:57
A brief comment explaining this check would be use
EhsanK
2016/06/29 14:04:19
Acknowledged.
|
| + return false; |
| + |
| + if (!frame) |
| + return false; |
| + |
| + WebVector<WebRect> result(characterCount); |
| + WebRect webrect; |
| + for (size_t i = 0; i < characterCount; ++i) { |
| + if (!frame->firstRectForCharacterRange(offset + i, 1, webrect)) { |
| + DLOG(ERROR) << "Could not retrieve character rectangle at " << i; |
| + return false; |
| + } |
| + result[i] = webrect; |
| + } |
| + bounds.swap(result); |
| + return true; |
| +} |
| + |
| +void WebViewImpl::adjustReplacementRangeForAccentedCharacters(int start, int length) |
| +{ |
| + if (WebLocalFrame* frame = focusedFrame()->toWebLocalFrame()) { |
| + WebRange webrange = WebRange::fromDocumentRange(frame, start, length); |
| + if (!webrange.isNull()) |
| + frame->selectRange(webrange); |
| + } |
| +} |
| + |
| // WebView -------------------------------------------------------------------- |
| WebSettingsImpl* WebViewImpl::settingsImpl() |