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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 19705013: [password autofill] Remove references to PasswordForm from RenderViewImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Callback Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 33b167a5397e3608d555a4c7f7d5617ff311066e..c4f635da186bc31b02dfc10e13eb362d3e054d50 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -289,13 +289,9 @@ WebKit::WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
void RenderFrameImpl::willSendSubmitEvent(WebKit::WebFrame* frame,
const WebKit::WebFormElement& form) {
- // Some login forms have onSubmit handlers that put a hash of the password
- // into a hidden field and then clear the password. (Issue 28910.)
- // This method gets called before any of those handlers run, so save away
- // a copy of the password in case it gets lost.
- DocumentState* document_state =
- DocumentState::FromDataSource(frame->dataSource());
- document_state->set_password_form_data(CreatePasswordForm(form));
+ // Call back to RenderViewImpl for observers to be notified.
+ // TODO(nasko): Remove once we have RenderFrameObserver.
+ render_view_->willSendSubmitEvent(frame, form);
}
void RenderFrameImpl::willSubmitForm(WebKit::WebFrame* frame,
@@ -316,25 +312,6 @@ void RenderFrameImpl::willSubmitForm(WebKit::WebFrame* frame,
internal_data->set_searchable_form_url(web_searchable_form_data.url());
internal_data->set_searchable_form_encoding(
web_searchable_form_data.encoding().utf8());
- scoped_ptr<PasswordForm> password_form_data =
- CreatePasswordForm(form);
-
- // In order to save the password that the user actually typed and not one
- // that may have gotten transformed by the site prior to submit, recover it
- // from the form contents already stored by |willSendSubmitEvent| into the
- // dataSource's NavigationState (as opposed to the provisionalDataSource's,
- // which is what we're storing into now.)
- if (password_form_data) {
- DocumentState* old_document_state =
- DocumentState::FromDataSource(frame->dataSource());
- if (old_document_state) {
- PasswordForm* old_form_data = old_document_state->password_form_data();
- if (old_form_data && old_form_data->action == password_form_data->action)
- password_form_data->password_value = old_form_data->password_value;
- }
- }
-
- document_state->set_password_form_data(password_form_data.Pass());
// Call back to RenderViewImpl for observers to be notified.
// TODO(nasko): Remove once we have RenderFrameObserver.

Powered by Google App Engine
This is Rietveld 408576698