| Index: third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
|
| diff --git a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
|
| index 4998d018a4b0aa5acf4cb15650c0c993af9e3956..c48c350c823b9098e7d0f59d3cf28aeafd068051 100644
|
| --- a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
|
| +++ b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
|
| @@ -50,6 +50,7 @@
|
| #include "platform/KeyboardCodes.h"
|
| #include "platform/graphics/CompositorMutatorClient.h"
|
| #include "public/platform/WebFrameScheduler.h"
|
| +#include "public/web/WebRange.h"
|
| #include "public/web/WebWidgetClient.h"
|
| #include "web/CompositorMutatorImpl.h"
|
| #include "web/CompositorProxyClientImpl.h"
|
| @@ -466,32 +467,28 @@ bool WebFrameWidgetImpl::setComposition(
|
| int selectionStart,
|
| int selectionEnd)
|
| {
|
| - // FIXME: To be implemented.
|
| - return false;
|
| + return view()->setComposition(text, underlines, selectionStart, selectionEnd);
|
| }
|
|
|
| bool WebFrameWidgetImpl::confirmComposition()
|
| {
|
| // FIXME: To be implemented.
|
| - return false;
|
| + return view()->confirmComposition();
|
| }
|
|
|
| bool WebFrameWidgetImpl::confirmComposition(ConfirmCompositionBehavior selectionBehavior)
|
| {
|
| - // FIXME: To be implemented.
|
| - return false;
|
| + return view()->confirmComposition(selectionBehavior);
|
| }
|
|
|
| bool WebFrameWidgetImpl::confirmComposition(const WebString& text)
|
| {
|
| - // FIXME: To be implemented.
|
| - return false;
|
| + return view()->confirmComposition(text);
|
| }
|
|
|
| bool WebFrameWidgetImpl::compositionRange(size_t* location, size_t* length)
|
| {
|
| - // FIXME: To be implemented.
|
| - return false;
|
| + return view()->compositionRange(location, length);
|
| }
|
|
|
| WebTextInputInfo WebFrameWidgetImpl::textInputInfo()
|
| @@ -645,6 +642,42 @@ void WebFrameWidgetImpl::didChangeWindowResizerRect()
|
| m_localRoot->frameView()->windowResizerRectChanged();
|
| }
|
|
|
| +bool WebFrameWidgetImpl::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 = focusedWebLocalFrameInWidget();
|
| + 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 WebFrameWidgetImpl::adjustReplacementRangeForAccentedCharacters(int start, int length)
|
| +{
|
| + if (WebLocalFrame* frame = focusedWebLocalFrameInWidget()) {
|
| + WebRange webrange = WebRange::fromDocumentRange(frame, start, length);
|
| + if (!webrange.isNull())
|
| + frame->selectRange(webrange);
|
| + }
|
| +}
|
| +
|
| void WebFrameWidgetImpl::handleMouseLeave(LocalFrame& mainFrame, const WebMouseEvent& event)
|
| {
|
| // FIXME: WebWidget doesn't have the method below.
|
| @@ -1116,4 +1149,10 @@ HitTestResult WebFrameWidgetImpl::hitTestResultForRootFramePos(const IntPoint& p
|
| return result;
|
| }
|
|
|
| +WebLocalFrame* WebFrameWidgetImpl::focusedWebLocalFrameInWidget() const
|
| +{
|
| + LocalFrame* frame = page()->focusController().focusedFrame();
|
| + return (frame && frame->localFrameRoot() == m_localRoot->frame()) ? WebLocalFrameImpl::from(frame) : nullptr;
|
| +}
|
| +
|
| } // namespace blink
|
|
|