Index: Source/web/ChromeClientImpl.cpp |
diff --git a/Source/web/ChromeClientImpl.cpp b/Source/web/ChromeClientImpl.cpp |
index 3a2b428185978edf3a9687f8a4cd37d81e6c403b..8c315a388a5f6f3e7e39af8f67b4cb8563bda48c 100644 |
--- a/Source/web/ChromeClientImpl.cpp |
+++ b/Source/web/ChromeClientImpl.cpp |
@@ -57,6 +57,7 @@ |
#include "core/rendering/HitTestResult.h" |
#include "core/rendering/RenderPart.h" |
#include "core/rendering/RenderWidget.h" |
+#include "core/rendering/compositing/CompositedSelectionBound.h" |
#include "platform/Cursor.h" |
#include "platform/FileChooser.h" |
#include "platform/NotImplemented.h" |
@@ -70,6 +71,7 @@ |
#include "public/platform/Platform.h" |
#include "public/platform/WebCursorInfo.h" |
#include "public/platform/WebRect.h" |
+#include "public/platform/WebSelectionBound.h" |
#include "public/platform/WebURLRequest.h" |
#include "public/web/WebAXObject.h" |
#include "public/web/WebAutofillClient.h" |
@@ -117,6 +119,18 @@ static WebAXEvent toWebAXEvent(AXObjectCache::AXNotification notification) |
return static_cast<WebAXEvent>(notification); |
} |
+static WebSelectionBound toWebSelectionBound(const CompositedSelectionBound& bound) |
+{ |
+ ASSERT(bound.layer); |
+ |
+ // These enums have the same values; enforced in AssertMatchingEnums.cpp. |
+ WebSelectionBound result(static_cast<WebSelectionBound::Type>(bound.type)); |
+ result.layerId = bound.layer->platformLayer()->id(); |
+ result.edgeTopInLayer = roundedIntPoint(bound.edgeTopInLayer); |
+ result.edgeBottomInLayer = roundedIntPoint(bound.edgeBottomInLayer); |
+ return result; |
+} |
+ |
ChromeClientImpl::ChromeClientImpl(WebViewImpl* webView) |
: m_webView(webView) |
, m_toolbarsVisible(true) |
@@ -702,6 +716,11 @@ void ChromeClientImpl::clearCompositedSelectionBounds() |
m_webView->clearCompositedSelectionBounds(); |
} |
+void ChromeClientImpl::updateCompositedSelectionBounds(const CompositedSelectionBound& anchor, const CompositedSelectionBound& focus) |
+{ |
+ m_webView->updateCompositedSelectionBounds(toWebSelectionBound(anchor), toWebSelectionBound(focus)); |
+} |
+ |
bool ChromeClientImpl::hasOpenedPopup() const |
{ |
return m_webView->hasOpenedPopup(); |