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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 const double minimumSecondToShowValidationMessage = 5.0; | 80 const double minimumSecondToShowValidationMessage = 5.0; |
81 const double secondPerCharacter = 0.05; | 81 const double secondPerCharacter = 0.05; |
82 const double statusCheckInterval = 0.1; | 82 const double statusCheckInterval = 0.1; |
83 | 83 |
84 m_webView.client()->showValidationMessage(anchorInViewport, m_message, toWeb
TextDirection(messageDir), | 84 m_webView.client()->showValidationMessage(anchorInViewport, m_message, toWeb
TextDirection(messageDir), |
85 subMessage, toWebTextDirection(subMessageDir)); | 85 subMessage, toWebTextDirection(subMessageDir)); |
86 | 86 |
87 m_finishTime = monotonicallyIncreasingTime() + std::max(minimumSecondToShowV
alidationMessage, (message.length() + subMessage.length()) * secondPerCharacter)
; | 87 m_finishTime = monotonicallyIncreasingTime() + std::max(minimumSecondToShowV
alidationMessage, (message.length() + subMessage.length()) * secondPerCharacter)
; |
88 // FIXME: We should invoke checkAnchorStatus actively when layout, scroll, | 88 // FIXME: We should invoke checkAnchorStatus actively when layout, scroll, |
89 // or page scale change happen. | 89 // or page scale change happen. |
90 m_timer.startRepeating(statusCheckInterval, FROM_HERE); | 90 m_timer.startRepeating(statusCheckInterval, BLINK_FROM_HERE); |
91 } | 91 } |
92 | 92 |
93 void ValidationMessageClientImpl::hideValidationMessage(const Element& anchor) | 93 void ValidationMessageClientImpl::hideValidationMessage(const Element& anchor) |
94 { | 94 { |
95 if (!m_currentAnchor || !isValidationMessageVisible(anchor)) | 95 if (!m_currentAnchor || !isValidationMessageVisible(anchor)) |
96 return; | 96 return; |
97 m_timer.stop(); | 97 m_timer.stop(); |
98 m_currentAnchor = nullptr; | 98 m_currentAnchor = nullptr; |
99 m_message = String(); | 99 m_message = String(); |
100 m_finishTime = 0; | 100 m_finishTime = 0; |
(...skipping 46 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 |