| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 finish_time_ = 0; | 108 finish_time_ = 0; |
| 109 web_view_.Client()->HideValidationMessage(); | 109 web_view_.Client()->HideValidationMessage(); |
| 110 web_view_.GetChromeClient().UnregisterPopupOpeningObserver(this); | 110 web_view_.GetChromeClient().UnregisterPopupOpeningObserver(this); |
| 111 } | 111 } |
| 112 | 112 |
| 113 bool ValidationMessageClientImpl::IsValidationMessageVisible( | 113 bool ValidationMessageClientImpl::IsValidationMessageVisible( |
| 114 const Element& anchor) { | 114 const Element& anchor) { |
| 115 return current_anchor_ == &anchor; | 115 return current_anchor_ == &anchor; |
| 116 } | 116 } |
| 117 | 117 |
| 118 void ValidationMessageClientImpl::WillUnloadDocument(const Document& document) { |
| 119 if (current_anchor_ && current_anchor_->GetDocument() == document) |
| 120 HideValidationMessage(*current_anchor_); |
| 121 } |
| 122 |
| 123 void ValidationMessageClientImpl::DocumentDetached(const Document& document) { |
| 124 DCHECK(!current_anchor_ || current_anchor_->GetDocument() != document) |
| 125 << "willUnloadDocument() should be called beforehand."; |
| 126 } |
| 127 |
| 118 void ValidationMessageClientImpl::CheckAnchorStatus(TimerBase*) { | 128 void ValidationMessageClientImpl::CheckAnchorStatus(TimerBase*) { |
| 119 DCHECK(current_anchor_); | 129 DCHECK(current_anchor_); |
| 120 if (MonotonicallyIncreasingTime() >= finish_time_ || !CurrentView()) { | 130 if (MonotonicallyIncreasingTime() >= finish_time_ || !CurrentView()) { |
| 121 HideValidationMessage(*current_anchor_); | 131 HideValidationMessage(*current_anchor_); |
| 122 return; | 132 return; |
| 123 } | 133 } |
| 124 | 134 |
| 125 IntRect new_anchor_rect_in_viewport = | 135 IntRect new_anchor_rect_in_viewport = |
| 126 current_anchor_->VisibleBoundsInVisualViewport(); | 136 current_anchor_->VisibleBoundsInVisualViewport(); |
| 127 if (new_anchor_rect_in_viewport.IsEmpty()) { | 137 if (new_anchor_rect_in_viewport.IsEmpty()) { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 149 if (current_anchor_) | 159 if (current_anchor_) |
| 150 HideValidationMessage(*current_anchor_); | 160 HideValidationMessage(*current_anchor_); |
| 151 } | 161 } |
| 152 | 162 |
| 153 DEFINE_TRACE(ValidationMessageClientImpl) { | 163 DEFINE_TRACE(ValidationMessageClientImpl) { |
| 154 visitor->Trace(current_anchor_); | 164 visitor->Trace(current_anchor_); |
| 155 ValidationMessageClient::Trace(visitor); | 165 ValidationMessageClient::Trace(visitor); |
| 156 } | 166 } |
| 157 | 167 |
| 158 } // namespace blink | 168 } // namespace blink |
| OLD | NEW |