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

Unified Diff: Source/WebKit/chromium/src/WebViewImpl.cpp

Issue 6532004: DO NOT SUBMIT (Closed) Base URL: git://git.webkit.org/WebKit.git@master
Patch Set: Address feedback Created 9 years, 9 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
« no previous file with comments | « Source/WebKit/chromium/src/WebViewImpl.h ('k') | Source/WebKit/chromium/src/mac/WebTextHelper.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebKit/chromium/src/WebViewImpl.cpp
diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp
index 102596b73198c8681aa7e1df8daef5e66bafcd01..a49b290e7a1ef9a3fd0821a56abe563023660912 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"
@@ -1384,6 +1385,24 @@ bool WebViewImpl::confirmComposition(const WebString& text)
return true;
}
+bool WebViewImpl::compositionRange(unsigned* location, unsigned* length)
+{
+ Frame* focused = focusedWebCoreFrame();
+ if (!focused || !m_imeAcceptEvents)
+ return false;
+ Editor* editor = focused->editor();
+ if (!editor || !editor->hasComposition())
+ return false;
+
+ RefPtr<Range> range = editor->compositionRange();
+ if (!range.get())
+ return false;
+
+ if (range->getLocationAndLength(*location, *length))
+ return true;
+ return false;
+}
+
WebTextInputType WebViewImpl::textInputType()
{
WebTextInputType type = WebTextInputTypeNone;
@@ -1444,6 +1463,25 @@ WebRect WebViewImpl::caretOrSelectionBounds()
return rect;
}
+bool WebViewImpl::caretOrSelectionRange(unsigned* location, unsigned* length)
+{
+ const Frame* focused = focusedWebCoreFrame();
+ if (!focused)
+ return false;
+
+ SelectionController* controller = focused->selection();
+ if (!controller)
+ return false;
+
+ RefPtr<Range> range = controller->selection().firstRange();
+ if (!range.get())
+ return false;
+
+ if (range->getLocationAndLength(*location, *length))
+ return true;
+ return false;
+}
+
void WebViewImpl::setTextDirection(WebTextDirection direction)
{
// The Editor::setBaseWritingDirection() function checks if we can change
« no previous file with comments | « Source/WebKit/chromium/src/WebViewImpl.h ('k') | Source/WebKit/chromium/src/mac/WebTextHelper.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698