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

Unified Diff: content/renderer/render_view_impl.cc

Issue 12713007: Fix the no password save issue for ajax login (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Again Created 7 years, 9 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
« no previous file with comments | « content/public/renderer/document_state.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 103160696c375713aa5a66f2b7eb577c31e21628..b1e6bbd836504227a5a64ac8db6628732b6e5350 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -3357,6 +3357,23 @@ void RenderViewImpl::didStartProvisionalLoad(WebFrame* frame) {
navigation_gesture_ = WebUserGestureIndicator::isProcessingUserGesture() ?
NavigationGestureUser : NavigationGestureAuto;
+ // If the navigation is not triggered by a user gesture, e.g. by some ajax
+ // callback, then inherit the submitted password form from the previous
+ // state. This fixes the no password save issue for ajax login, tracked in
+ // [http://crbug/43219]. Note that there are still some sites that this
+ // fails for because they use some element other than a submit button to
+ // trigger submission.
+ if (navigation_gesture_ == NavigationGestureAuto) {
+ DocumentState* old_document_state = DocumentState::FromDataSource(
+ frame->dataSource());
+ const content::PasswordForm* old_password_form =
+ old_document_state->password_form_data();
+ if (old_password_form) {
+ document_state->set_password_form_data(
+ make_scoped_ptr(new content::PasswordForm(*old_password_form)));
+ }
+ }
+
// Make sure redirect tracking state is clear for the new load.
completed_client_redirect_src_ = Referrer();
} else if (frame->parent()->isLoading()) {
« no previous file with comments | « content/public/renderer/document_state.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698