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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 m_message = String(); | 104 m_message = String(); |
105 m_finishTime = 0; | 105 m_finishTime = 0; |
106 m_webView.client()->hideValidationMessage(); | 106 m_webView.client()->hideValidationMessage(); |
107 } | 107 } |
108 | 108 |
109 bool ValidationMessageClientImpl::isValidationMessageVisible( | 109 bool ValidationMessageClientImpl::isValidationMessageVisible( |
110 const Element& anchor) { | 110 const Element& anchor) { |
111 return m_currentAnchor == &anchor; | 111 return m_currentAnchor == &anchor; |
112 } | 112 } |
113 | 113 |
114 void ValidationMessageClientImpl::documentDetached(const Document& document) { | 114 void ValidationMessageClientImpl::willUnloadDocument(const Document& document) { |
115 if (m_currentAnchor && m_currentAnchor->document() == document) | 115 if (m_currentAnchor && m_currentAnchor->document() == document) |
116 hideValidationMessage(*m_currentAnchor); | 116 hideValidationMessage(*m_currentAnchor); |
117 } | 117 } |
118 | 118 |
| 119 void ValidationMessageClientImpl::documentDetached(const Document& document) { |
| 120 DCHECK(!m_currentAnchor || m_currentAnchor->document() != document) |
| 121 << "willUnloadDocument() should be called beforehand."; |
| 122 } |
| 123 |
119 void ValidationMessageClientImpl::checkAnchorStatus(TimerBase*) { | 124 void ValidationMessageClientImpl::checkAnchorStatus(TimerBase*) { |
120 DCHECK(m_currentAnchor); | 125 DCHECK(m_currentAnchor); |
121 if (monotonicallyIncreasingTime() >= m_finishTime || !currentView()) { | 126 if (monotonicallyIncreasingTime() >= m_finishTime || !currentView()) { |
122 hideValidationMessage(*m_currentAnchor); | 127 hideValidationMessage(*m_currentAnchor); |
123 return; | 128 return; |
124 } | 129 } |
125 | 130 |
126 IntRect newAnchorRectInViewport = | 131 IntRect newAnchorRectInViewport = |
127 m_currentAnchor->visibleBoundsInVisualViewport(); | 132 m_currentAnchor->visibleBoundsInVisualViewport(); |
128 if (newAnchorRectInViewport.isEmpty()) { | 133 if (newAnchorRectInViewport.isEmpty()) { |
(...skipping 16 matching lines...) Expand all Loading... |
145 if (m_currentAnchor) | 150 if (m_currentAnchor) |
146 hideValidationMessage(*m_currentAnchor); | 151 hideValidationMessage(*m_currentAnchor); |
147 } | 152 } |
148 | 153 |
149 DEFINE_TRACE(ValidationMessageClientImpl) { | 154 DEFINE_TRACE(ValidationMessageClientImpl) { |
150 visitor->trace(m_currentAnchor); | 155 visitor->trace(m_currentAnchor); |
151 ValidationMessageClient::trace(visitor); | 156 ValidationMessageClient::trace(visitor); |
152 } | 157 } |
153 | 158 |
154 } // namespace blink | 159 } // namespace blink |
OLD | NEW |