| OLD | NEW |
| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 if (result.innerNode() && result.innerNode()->document().isDNSPrefetchEnable
d()) | 133 if (result.innerNode() && result.innerNode()->document().isDNSPrefetchEnable
d()) |
| 134 prefetchDNS(result.absoluteLinkURL().host()); | 134 prefetchDNS(result.absoluteLinkURL().host()); |
| 135 | 135 |
| 136 showMouseOverURL(result); | 136 showMouseOverURL(result); |
| 137 | 137 |
| 138 setToolTip(result); | 138 setToolTip(result); |
| 139 } | 139 } |
| 140 | 140 |
| 141 void ChromeClient::setToolTip(const HitTestResult& result) | 141 void ChromeClient::setToolTip(const HitTestResult& result) |
| 142 { | 142 { |
| 143 // First priority is a potential toolTip representing a spelling or grammar | 143 // First priority is a tooltip for element with "title" attribute. |
| 144 // error. | |
| 145 TextDirection toolTipDirection; | 144 TextDirection toolTipDirection; |
| 146 String toolTip = result.spellingToolTip(toolTipDirection); | 145 String toolTip = result.title(toolTipDirection); |
| 147 | |
| 148 // Next we'll consider a tooltip for element with "title" attribute. | |
| 149 if (toolTip.isEmpty()) | |
| 150 toolTip = result.title(toolTipDirection); | |
| 151 | 146 |
| 152 // Lastly, some elements provide default tooltip strings. e.g. <input | 147 // Lastly, some elements provide default tooltip strings. e.g. <input |
| 153 // type="file" multiple> shows a tooltip for the selected filenames. | 148 // type="file" multiple> shows a tooltip for the selected filenames. |
| 154 if (toolTip.isEmpty()) { | 149 if (toolTip.isEmpty()) { |
| 155 if (Node* node = result.innerNode()) { | 150 if (Node* node = result.innerNode()) { |
| 156 if (node->isElementNode()) { | 151 if (node->isElementNode()) { |
| 157 toolTip = toElement(node)->defaultToolTip(); | 152 toolTip = toElement(node)->defaultToolTip(); |
| 158 | 153 |
| 159 // FIXME: We should obtain text direction of tooltip from | 154 // FIXME: We should obtain text direction of tooltip from |
| 160 // ChromeClient or platform. As of October 2011, all client | 155 // ChromeClient or platform. As of October 2011, all client |
| (...skipping 23 matching lines...) Expand all Loading... |
| 184 { | 179 { |
| 185 // Defer loads in case the client method runs a new event loop that would | 180 // Defer loads in case the client method runs a new event loop that would |
| 186 // otherwise cause the load to continue while we're in the middle of | 181 // otherwise cause the load to continue while we're in the middle of |
| 187 // executing JavaScript. | 182 // executing JavaScript. |
| 188 ScopedPageLoadDeferrer deferrer; | 183 ScopedPageLoadDeferrer deferrer; |
| 189 | 184 |
| 190 printDelegate(frame); | 185 printDelegate(frame); |
| 191 } | 186 } |
| 192 | 187 |
| 193 } // namespace blink | 188 } // namespace blink |
| OLD | NEW |