Index: Source/WebKit/chromium/src/WebViewImpl.cpp |
diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp |
index 237ce0093d4b677d9a60423de43c5d8ffe8ce5d9..2bcdaf66f7b437f497a9f230f4101f4657982b30 100644 |
--- a/Source/WebKit/chromium/src/WebViewImpl.cpp |
+++ b/Source/WebKit/chromium/src/WebViewImpl.cpp |
@@ -114,6 +114,7 @@ |
#include "WebPluginContainerImpl.h" |
#include "WebPoint.h" |
#include "WebPopupMenuImpl.h" |
+#include "WebRange.h" |
#include "WebRect.h" |
#include "WebRuntimeFeatures.h" |
#include "WebSettingsImpl.h" |
@@ -1350,6 +1351,17 @@ bool WebViewImpl::confirmComposition(const WebString& text) |
return true; |
} |
+WebRange WebViewImpl::compositionRange() |
+{ |
+ Frame* focused = focusedWebCoreFrame(); |
+ if (!focused || !m_imeAcceptEvents) |
+ return WebRange(); |
+ Editor* editor = focused->editor(); |
+ if (!editor || !editor->hasComposition()) |
+ return WebRange(); |
+ return editor->compositionRange(); |
+} |
+ |
WebTextInputType WebViewImpl::textInputType() |
{ |
WebTextInputType type = WebTextInputTypeNone; |
@@ -1410,6 +1422,20 @@ WebRect WebViewImpl::caretOrSelectionBounds() |
return rect; |
} |
+WebRange WebViewImpl::caretOrSelectionRange() |
+{ |
+ WebRange range; |
+ const Frame* focused = focusedWebCoreFrame(); |
+ if (!focused) |
+ return range; |
+ |
+ SelectionController* controller = focused->selection(); |
+ if (!controller) |
+ return range; |
+ |
+ return controller->toNormalizedRange(); |
+} |
+ |
void WebViewImpl::setTextDirection(WebTextDirection direction) |
{ |
// The Editor::setBaseWritingDirection() function checks if we can change |