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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 if (toolTip.isEmpty()) { | 175 if (toolTip.isEmpty()) { |
176 if (Node* node = result.innerNode()) { | 176 if (Node* node = result.innerNode()) { |
177 if (node->isElementNode()) { | 177 if (node->isElementNode()) { |
178 toolTip = toElement(node)->defaultToolTip(); | 178 toolTip = toElement(node)->defaultToolTip(); |
179 | 179 |
180 // FIXME: We should obtain text direction of tooltip from | 180 // FIXME: We should obtain text direction of tooltip from |
181 // ChromeClient or platform. As of October 2011, all client | 181 // ChromeClient or platform. As of October 2011, all client |
182 // implementations don't use text direction information for | 182 // implementations don't use text direction information for |
183 // ChromeClient::setToolTip. We'll work on tooltip text | 183 // ChromeClient::setToolTip. We'll work on tooltip text |
184 // direction during bidi cleanup in form inputs. | 184 // direction during bidi cleanup in form inputs. |
185 toolTipDirection = TextDirection::Ltr; | 185 toolTipDirection = TextDirection::kLtr; |
186 } | 186 } |
187 } | 187 } |
188 } | 188 } |
189 | 189 |
190 if (m_lastToolTipPoint == result.hitTestLocation().point() && | 190 if (m_lastToolTipPoint == result.hitTestLocation().point() && |
191 m_lastToolTipText == toolTip) | 191 m_lastToolTipText == toolTip) |
192 return; | 192 return; |
193 m_lastToolTipPoint = result.hitTestLocation().point(); | 193 m_lastToolTipPoint = result.hitTestLocation().point(); |
194 m_lastToolTipText = toolTip; | 194 m_lastToolTipText = toolTip; |
195 setToolTip(frame, toolTip, toolTipDirection); | 195 setToolTip(frame, toolTip, toolTipDirection); |
196 } | 196 } |
197 | 197 |
198 void ChromeClient::clearToolTip(LocalFrame& frame) { | 198 void ChromeClient::clearToolTip(LocalFrame& frame) { |
199 // Do not check m_lastToolTip* and do not update them intentionally. | 199 // Do not check m_lastToolTip* and do not update them intentionally. |
200 // We don't want to show tooltips with same content after clearToolTip(). | 200 // We don't want to show tooltips with same content after clearToolTip(). |
201 setToolTip(frame, String(), TextDirection::Ltr); | 201 setToolTip(frame, String(), TextDirection::kLtr); |
202 } | 202 } |
203 | 203 |
204 bool ChromeClient::print(LocalFrame* frame) { | 204 bool ChromeClient::print(LocalFrame* frame) { |
205 if (frame->document()->isSandboxed(SandboxModals)) { | 205 if (frame->document()->isSandboxed(SandboxModals)) { |
206 UseCounter::count(frame, UseCounter::DialogInSandboxedContext); | 206 UseCounter::count(frame, UseCounter::DialogInSandboxedContext); |
207 frame->console().addMessage(ConsoleMessage::create( | 207 frame->console().addMessage(ConsoleMessage::create( |
208 SecurityMessageSource, ErrorMessageLevel, | 208 SecurityMessageSource, ErrorMessageLevel, |
209 "Ignored call to 'print()'. The document is sandboxed, and the " | 209 "Ignored call to 'print()'. The document is sandboxed, and the " |
210 "'allow-modals' keyword is not set.")); | 210 "'allow-modals' keyword is not set.")); |
211 return false; | 211 return false; |
212 } | 212 } |
213 | 213 |
214 // Suspend pages in case the client method runs a new event loop that would | 214 // Suspend pages in case the client method runs a new event loop that would |
215 // otherwise cause the load to continue while we're in the middle of | 215 // otherwise cause the load to continue while we're in the middle of |
216 // executing JavaScript. | 216 // executing JavaScript. |
217 ScopedPageSuspender suspender; | 217 ScopedPageSuspender suspender; |
218 | 218 |
219 printDelegate(frame); | 219 printDelegate(frame); |
220 return true; | 220 return true; |
221 } | 221 } |
222 | 222 |
223 } // namespace blink | 223 } // namespace blink |
OLD | NEW |