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

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: removed todo 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 c122b748d3ca6915260bbfefec48538f1d5a06ed..9ff0edf7189af48e6a0d812bb0fe82c6ed7fc1bb 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)
{
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)
« 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