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

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

Issue 1454363002: Close tooltip for |title| attribute on any keyboard event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix DOCTYPE Created 5 years, 1 month 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
« no previous file with comments | « third_party/WebKit/Source/web/ChromeClientImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 cb3e93d7e04f494913bb57c2e5a3d389e5b991fa..5488a951af657152cd3f6241aaf0d61bd38b3f31 100644
--- a/third_party/WebKit/Source/web/ChromeClientImpl.cpp
+++ b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
@@ -122,6 +122,7 @@ static WebAXEvent toWebAXEvent(AXObjectCache::AXNotification notification)
ChromeClientImpl::ChromeClientImpl(WebViewImpl* webView)
: m_webView(webView)
, m_cursorOverridden(false)
+ , m_didRequestNonEmptyToolTip(false)
{
}
@@ -576,8 +577,17 @@ void ChromeClientImpl::showMouseOverURL(const HitTestResult& result)
void ChromeClientImpl::setToolTip(const String& tooltipText, TextDirection dir)
{
- if (m_webView->client())
+ if (!m_webView->client())
+ return;
+ if (!tooltipText.isEmpty()) {
m_webView->client()->setToolTipText(tooltipText, toWebTextDirection(dir));
+ m_didRequestNonEmptyToolTip = true;
+ } else if (m_didRequestNonEmptyToolTip) {
+ // WebViewClient::setToolTipText will send an IPC message. We'd like to
+ // reduce the number of setToolTipText calls.
+ m_webView->client()->setToolTipText(tooltipText, toWebTextDirection(dir));
+ m_didRequestNonEmptyToolTip = false;
+ }
}
void ChromeClientImpl::dispatchViewportPropertiesDidChange(const ViewportDescription& description) const
« no previous file with comments | « third_party/WebKit/Source/web/ChromeClientImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698