Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: third_party/WebKit/Source/web/ValidationMessageClientImpl.cpp

Issue 2782093003: Merge "Form validation: Validation bubble should be closed on document unload process." to M58 (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/web/ValidationMessageClientImpl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/ValidationMessageClientImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698