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

Side by Side Diff: third_party/WebKit/Source/core/page/ValidationMessageClientImpl.cpp

Issue 2949593003: Move navigation-induced hiding of form-validation-bubble to the browser process. (Closed)
Patch Set: Remove now unnecessary call from WebContentsImpl::RenderViewTerminated to delegate_->HideValidation… Created 3 years, 6 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/core/page/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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
128 void ValidationMessageClientImpl::CheckAnchorStatus(TimerBase*) { 118 void ValidationMessageClientImpl::CheckAnchorStatus(TimerBase*) {
129 DCHECK(current_anchor_); 119 DCHECK(current_anchor_);
130 if (MonotonicallyIncreasingTime() >= finish_time_ || !CurrentView()) { 120 if (MonotonicallyIncreasingTime() >= finish_time_ || !CurrentView()) {
131 HideValidationMessage(*current_anchor_); 121 HideValidationMessage(*current_anchor_);
132 return; 122 return;
133 } 123 }
134 124
135 IntRect new_anchor_rect_in_viewport = 125 IntRect new_anchor_rect_in_viewport =
136 current_anchor_->VisibleBoundsInVisualViewport(); 126 current_anchor_->VisibleBoundsInVisualViewport();
137 if (new_anchor_rect_in_viewport.IsEmpty()) { 127 if (new_anchor_rect_in_viewport.IsEmpty()) {
(...skipping 21 matching lines...) Expand all
159 if (current_anchor_) 149 if (current_anchor_)
160 HideValidationMessage(*current_anchor_); 150 HideValidationMessage(*current_anchor_);
161 } 151 }
162 152
163 DEFINE_TRACE(ValidationMessageClientImpl) { 153 DEFINE_TRACE(ValidationMessageClientImpl) {
164 visitor->Trace(current_anchor_); 154 visitor->Trace(current_anchor_);
165 ValidationMessageClient::Trace(visitor); 155 ValidationMessageClient::Trace(visitor);
166 } 156 }
167 157
168 } // namespace blink 158 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/page/ValidationMessageClientImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698