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

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

Issue 1382593004: Allow out-of-process iframes to update the mouse cursor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits addressed Created 5 years, 2 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/ChromeClientImpl.cpp
diff --git a/third_party/WebKit/Source/web/ChromeClientImpl.cpp b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
index 557722836f82fc77c9810d39fe8cf57e3be3ddcd..b53773a4d04bf7103f6c9cae51d316a77264c0aa 100644
--- a/third_party/WebKit/Source/web/ChromeClientImpl.cpp
+++ b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
@@ -662,13 +662,13 @@ Cursor ChromeClientImpl::lastSetCursorForTesting() const
return m_lastSetMouseCursorForTesting;
}
-void ChromeClientImpl::setCursor(const Cursor& cursor)
+void ChromeClientImpl::setCursor(const Cursor& cursor, LocalFrame* localRoot)
{
m_lastSetMouseCursorForTesting = cursor;
- setCursor(WebCursorInfo(cursor));
+ setCursor(WebCursorInfo(cursor), localRoot);
}
-void ChromeClientImpl::setCursor(const WebCursorInfo& cursor)
+void ChromeClientImpl::setCursor(const WebCursorInfo& cursor, LocalFrame* localRoot)
{
if (m_cursorOverridden)
return;
@@ -679,13 +679,25 @@ void ChromeClientImpl::setCursor(const WebCursorInfo& cursor)
if (m_webView->hasOpenedPopup())
return;
#endif
- if (m_webView->client())
+ if (!m_webView->client())
+ return;
+ // TODO(kenrb, dcheng): For top-level frames we still use the WebView as
+ // a WebWidget. This special case will be removed when top-level frames
+ // get WebFrameWidgets.
+ if (localRoot->isMainFrame()) {
m_webView->client()->didChangeCursor(cursor);
+ } else {
+ WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(localRoot);
+ ASSERT(webFrame);
+ ASSERT(webFrame->frameWidget());
+ if (toWebFrameWidgetImpl(webFrame->frameWidget())->client())
+ toWebFrameWidgetImpl(webFrame->frameWidget())->client()->didChangeCursor(cursor);
+ }
}
void ChromeClientImpl::setCursorForPlugin(const WebCursorInfo& cursor)
{
- setCursor(cursor);
+ setCursor(cursor, m_webView->page()->deprecatedLocalMainFrame());
}
void ChromeClientImpl::setCursorOverridden(bool overridden)
« no previous file with comments | « third_party/WebKit/Source/web/ChromeClientImpl.h ('k') | third_party/WebKit/Source/web/InspectorOverlay.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698