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

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: 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
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index aada5385168d131fb1886618358ac5c844f567f2..c98a83403f7d6c41b9398aa3aa284e1306a004c5 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -3431,6 +3431,24 @@ void RenderViewImpl::didStartProvisionalLoad(WebFrame* frame) {
navigation_gesture_ = WebUserGestureIndicator::isProcessingUserGesture() ?
NavigationGestureUser : NavigationGestureAuto;
+ // If the navigation is not triggered by user gesture, e.g. by some ajax
Ilya Sherman 2013/03/22 03:26:48 nit: "by user gesture" -> "by a user gesture"
Garrett Casto 2013/03/22 21:05:05 Done.
+ // callback, then inherit the submitted password form from the previous
+ // state. This fixes the no password save issue for ajax login, tracked in
+ // crbug/43219. Note that there are still some sites that this fails for
Ilya Sherman 2013/03/22 03:26:48 nit: Add "http://", and ideally find some way to s
Garrett Casto 2013/03/22 21:05:05 Done.
+ // because they use some element other than a submit button to trigger
+ // submission.
+ if (navigation_gesture_ == NavigationGestureAuto) {
+ DocumentState* document_state_old = DocumentState::FromDataSource(
+ frame->dataSource());
+ const content::PasswordForm* password_form_old =
+ document_state_old->password_form_data();
+ if (password_form_old) {
+ document_state->set_password_form_data(
+ scoped_ptr<content::PasswordForm>(
Ilya Sherman 2013/03/22 03:26:48 nit: Consider using make_scoped_ptr() here.
Garrett Casto 2013/03/22 21:05:05 Done.
+ new content::PasswordForm(*password_form_old)));
+ }
+ }
+
// Make sure redirect tracking state is clear for the new load.
completed_client_redirect_src_ = Referrer();
} else if (frame->parent()->isLoading()) {

Powered by Google App Engine
This is Rietveld 408576698