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

Unified Diff: third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp

Issue 2029423003: OOPIF IME: Renderer Side Changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
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 5b8b0654e78eb10ef558300e1352531057ca82be..c02e234784f63bdc9f04856bd8f25cb3169eb119 100644
--- a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
+++ b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
@@ -51,6 +51,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"
@@ -470,32 +471,28 @@ bool WebFrameWidgetImpl::setComposition(
int selectionStart,
int selectionEnd)
{
- // FIXME: To be implemented.
- return false;
+ return view()->setComposition(text, underlines, selectionStart, selectionEnd);
lfg 2016/07/05 18:30:46 Can you implement those functions here, instead of
EhsanK 2016/07/07 14:40:47 I initially wanted to keep this CL short so I only
kenrb 2016/07/07 15:30:38 Is it really better this way? One advantage of del
EhsanK 2016/07/07 20:25:07 Some of the changes made can be argued to be not r
}
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()
@@ -664,6 +661,42 @@ void WebFrameWidgetImpl::didLosePointerLock()
page()->pointerLockController().didLosePointerLock();
}
+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)
lfg 2016/07/05 18:30:46 Why |frame| can be null? Do we call this function
EhsanK 2016/07/07 14:40:47 Yes as the route of this call could be an update o
lfg 2016/07/07 15:13:31 So, in this example, can't you just early return i
EhsanK 2016/07/07 20:25:07 We still need to send the IPC so it comes down to
lfg 2016/07/07 20:58:26 Acknowledged.
+ 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::applyReplacementRange(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.
@@ -1135,4 +1168,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::fromFrame(frame) : nullptr;
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698