OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 { | 61 { |
62 return m_currentAnchor->document().view(); | 62 return m_currentAnchor->document().view(); |
63 } | 63 } |
64 | 64 |
65 void ValidationMessageClientImpl::showValidationMessage(const Element& anchor, c
onst String& message, TextDirection messageDir, const String& subMessage, TextDi
rection subMessageDir) | 65 void ValidationMessageClientImpl::showValidationMessage(const Element& anchor, c
onst String& message, TextDirection messageDir, const String& subMessage, TextDi
rection subMessageDir) |
66 { | 66 { |
67 if (message.isEmpty()) { | 67 if (message.isEmpty()) { |
68 hideValidationMessage(anchor); | 68 hideValidationMessage(anchor); |
69 return; | 69 return; |
70 } | 70 } |
71 if (!anchor.renderBox()) | 71 if (!anchor.layoutBox()) |
72 return; | 72 return; |
73 if (m_currentAnchor) | 73 if (m_currentAnchor) |
74 hideValidationMessage(*m_currentAnchor); | 74 hideValidationMessage(*m_currentAnchor); |
75 m_currentAnchor = &anchor; | 75 m_currentAnchor = &anchor; |
76 IntRect anchorInViewport = currentView()->contentsToWindow(anchor.pixelSnapp
edBoundingBox()); | 76 IntRect anchorInViewport = currentView()->contentsToWindow(anchor.pixelSnapp
edBoundingBox()); |
77 m_lastAnchorRectInScreen = currentView()->hostWindow()->viewportToScreen(anc
horInViewport); | 77 m_lastAnchorRectInScreen = currentView()->hostWindow()->viewportToScreen(anc
horInViewport); |
78 m_lastPageScaleFactor = m_webView.pageScaleFactor(); | 78 m_lastPageScaleFactor = m_webView.pageScaleFactor(); |
79 m_message = message; | 79 m_message = message; |
80 const double minimumSecondToShowValidationMessage = 5.0; | 80 const double minimumSecondToShowValidationMessage = 5.0; |
81 const double secondPerCharacter = 0.05; | 81 const double secondPerCharacter = 0.05; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 hideValidationMessage(*m_currentAnchor); | 147 hideValidationMessage(*m_currentAnchor); |
148 } | 148 } |
149 | 149 |
150 DEFINE_TRACE(ValidationMessageClientImpl) | 150 DEFINE_TRACE(ValidationMessageClientImpl) |
151 { | 151 { |
152 visitor->trace(m_currentAnchor); | 152 visitor->trace(m_currentAnchor); |
153 ValidationMessageClient::trace(visitor); | 153 ValidationMessageClient::trace(visitor); |
154 } | 154 } |
155 | 155 |
156 } // namespace blink | 156 } // namespace blink |
OLD | NEW |