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

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

Issue 2043903002: Move didChangeCursor calls from WebViewClient to WebWidgetClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: inspector overlay Created 4 years, 5 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 4afc8d8bf3140982b3bcac4e5c23fa721cb4eb86..1f50b688d7cb5b20a63d23ada02c0d8c15b00e14 100644
--- a/third_party/WebKit/Source/web/ChromeClientImpl.cpp
+++ b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
@@ -732,13 +732,13 @@ Cursor ChromeClientImpl::lastSetCursorForTesting() const
return m_lastSetMouseCursorForTesting;
}
-void ChromeClientImpl::setCursor(const Cursor& cursor, LocalFrame* localRoot)
+void ChromeClientImpl::setCursor(const Cursor& cursor, LocalFrame* localFrame)
{
m_lastSetMouseCursorForTesting = cursor;
- setCursor(WebCursorInfo(cursor), localRoot);
+ setCursor(WebCursorInfo(cursor), localFrame);
}
-void ChromeClientImpl::setCursor(const WebCursorInfo& cursor, LocalFrame* localRoot)
+void ChromeClientImpl::setCursor(const WebCursorInfo& cursor, LocalFrame* localFrame)
dcheng 2016/07/07 01:49:12 Please update the caller in FrameView to just pass
lfg 2016/07/07 14:36:21 Done.
{
if (m_cursorOverridden)
return;
@@ -749,25 +749,15 @@ void ChromeClientImpl::setCursor(const WebCursorInfo& cursor, LocalFrame* localR
if (m_webView->hasOpenedPopup())
return;
#endif
- 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);
- DCHECK(webFrame);
- DCHECK(webFrame->frameWidget());
- if (toWebFrameWidgetImpl(webFrame->frameWidget())->client())
- toWebFrameWidgetImpl(webFrame->frameWidget())->client()->didChangeCursor(cursor);
- }
+
+ LocalFrame* localRoot = localFrame->localFrameRoot();
+ if (WebFrameWidget* widget = WebLocalFrameImpl::fromFrame(localRoot)->frameWidget())
+ widget->client()->didChangeCursor(cursor);
}
-void ChromeClientImpl::setCursorForPlugin(const WebCursorInfo& cursor, LocalFrame* localRoot)
+void ChromeClientImpl::setCursorForPlugin(const WebCursorInfo& cursor, LocalFrame* localFrame)
{
- setCursor(cursor, localRoot);
+ setCursor(cursor, localFrame);
}
void ChromeClientImpl::setCursorOverridden(bool overridden)

Powered by Google App Engine
This is Rietveld 408576698