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

Side by Side Diff: third_party/WebKit/Source/core/page/ChromeClient.cpp

Issue 2681803002: blink: clear tooltips on frame leaves (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2009, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2009, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2012, Samsung Electronics. All rights reserved. 4 * Copyright (C) 2012, Samsung Electronics. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 prefetchDNS(result.absoluteLinkURL().host()); 163 prefetchDNS(result.absoluteLinkURL().host());
164 164
165 showMouseOverURL(result); 165 showMouseOverURL(result);
166 166
167 if (result.scrollbar()) 167 if (result.scrollbar())
168 clearToolTip(frame); 168 clearToolTip(frame);
169 else 169 else
170 setToolTip(frame, result); 170 setToolTip(frame, result);
171 } 171 }
172 172
173 void ChromeClient::mouseDidLeave(LocalFrame& frame) {
174 clearToolTip(frame);
175 }
176
173 void ChromeClient::setToolTip(LocalFrame& frame, const HitTestResult& result) { 177 void ChromeClient::setToolTip(LocalFrame& frame, const HitTestResult& result) {
174 // First priority is a tooltip for element with "title" attribute. 178 // First priority is a tooltip for element with "title" attribute.
175 TextDirection toolTipDirection; 179 TextDirection toolTipDirection;
176 String toolTip = result.title(toolTipDirection); 180 String toolTip = result.title(toolTipDirection);
177 181
178 // Lastly, some elements provide default tooltip strings. e.g. <input 182 // Lastly, some elements provide default tooltip strings. e.g. <input
179 // type="file" multiple> shows a tooltip for the selected filenames. 183 // type="file" multiple> shows a tooltip for the selected filenames.
180 if (toolTip.isEmpty()) { 184 if (toolTip.isEmpty()) {
181 if (Node* node = result.innerNode()) { 185 if (Node* node = result.innerNode()) {
182 if (node->isElementNode()) { 186 if (node->isElementNode()) {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 // Suspend pages in case the client method runs a new event loop that would 235 // Suspend pages in case the client method runs a new event loop that would
232 // otherwise cause the load to continue while we're in the middle of 236 // otherwise cause the load to continue while we're in the middle of
233 // executing JavaScript. 237 // executing JavaScript.
234 ScopedPageSuspender suspender; 238 ScopedPageSuspender suspender;
235 239
236 printDelegate(frame); 240 printDelegate(frame);
237 return true; 241 return true;
238 } 242 }
239 243
240 } // namespace blink 244 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698