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

Unified Diff: Source/web/ChromeClientImpl.cpp

Issue 454643002: Route selection bounds updates through WebLayerTreeView (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix bug in tests Created 6 years, 3 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: 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();

Powered by Google App Engine
This is Rietveld 408576698