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 efbf922cdfbdac898eab223349a8e45aba96ae5b..bbc8efa3335f9e15104384ed8f7fcda96d2e48a3 100644 |
| --- a/third_party/WebKit/Source/web/WebViewImpl.cpp |
| +++ b/third_party/WebKit/Source/web/WebViewImpl.cpp |
| @@ -2856,6 +2856,33 @@ void WebViewImpl::reportFixedRasterScaleUseCounters(bool hasBlurryContent, bool |
| UseCounter::count(document, UseCounter::FixedRasterScalePotentialPerformanceRegression); |
| } |
| +bool WebViewImpl::getCompositionCharacterBounds(WebVector<WebRect>& bounds) |
|
EhsanK
2016/06/03 02:38:54
This is basically RenderViewImpl::GetCompositionCh
kenrb
2016/06/07 20:18:13
Seems fine, to me.
|
| +{ |
| + 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) |
| + 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; |
| +} |
| + |
| // WebView -------------------------------------------------------------------- |
| WebSettingsImpl* WebViewImpl::settingsImpl() |