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

Unified Diff: third_party/WebKit/Source/core/page/ChromeClient.cpp

Issue 1504743002: Do not show a tooltip same as the previous one. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2564
Patch Set: Created 5 years 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/core/page/ChromeClient.cpp
diff --git a/third_party/WebKit/Source/core/page/ChromeClient.cpp b/third_party/WebKit/Source/core/page/ChromeClient.cpp
index ac605312b7dd7d5df7401adf1fe9ecdd92d03755..89c71fea82d11e0100527ddc253ea19e0e147ace 100644
--- a/third_party/WebKit/Source/core/page/ChromeClient.cpp
+++ b/third_party/WebKit/Source/core/page/ChromeClient.cpp
@@ -167,9 +167,20 @@ void ChromeClient::setToolTip(const HitTestResult& result)
}
}
+ if (m_lastToolTipPoint == result.hitTestLocation().point() && m_lastToolTipText == toolTip)
+ return;
+ m_lastToolTipPoint = result.hitTestLocation().point();
+ m_lastToolTipText = toolTip;
setToolTip(toolTip, toolTipDirection);
}
+void ChromeClient::clearToolTip()
+{
+ // Do not check m_lastToolTip* and do not update them intentionally.
+ // We don't want to show tooltips with same content after clearToolTip().
+ setToolTip(String(), LTR);
+}
+
void ChromeClient::print(LocalFrame* frame)
{
// Defer loads in case the client method runs a new event loop that would
« no previous file with comments | « third_party/WebKit/Source/core/page/ChromeClient.h ('k') | third_party/WebKit/Source/core/page/ChromeClientTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698