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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 3413 matching lines...) Expand 10 before | Expand all | Expand 10 after
3424 } 3424 }
3425 3425
3426 // Start time is only set after request time. 3426 // Start time is only set after request time.
3427 document_state->set_start_load_time(Time::Now()); 3427 document_state->set_start_load_time(Time::Now());
3428 3428
3429 bool is_top_most = !frame->parent(); 3429 bool is_top_most = !frame->parent();
3430 if (is_top_most) { 3430 if (is_top_most) {
3431 navigation_gesture_ = WebUserGestureIndicator::isProcessingUserGesture() ? 3431 navigation_gesture_ = WebUserGestureIndicator::isProcessingUserGesture() ?
3432 NavigationGestureUser : NavigationGestureAuto; 3432 NavigationGestureUser : NavigationGestureAuto;
3433 3433
3434 // 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.
3435 // callback, then inherit the submitted password form from the previous
3436 // state. This fixes the no password save issue for ajax login, tracked in
3437 // 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.
3438 // because they use some element other than a submit button to trigger
3439 // submission.
3440 if (navigation_gesture_ == NavigationGestureAuto) {
3441 DocumentState* document_state_old = DocumentState::FromDataSource(
3442 frame->dataSource());
3443 const content::PasswordForm* password_form_old =
3444 document_state_old->password_form_data();
3445 if (password_form_old) {
3446 document_state->set_password_form_data(
3447 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.
3448 new content::PasswordForm(*password_form_old)));
3449 }
3450 }
3451
3434 // Make sure redirect tracking state is clear for the new load. 3452 // Make sure redirect tracking state is clear for the new load.
3435 completed_client_redirect_src_ = Referrer(); 3453 completed_client_redirect_src_ = Referrer();
3436 } else if (frame->parent()->isLoading()) { 3454 } else if (frame->parent()->isLoading()) {
3437 // Take note of AUTO_SUBFRAME loads here, so that we can know how to 3455 // Take note of AUTO_SUBFRAME loads here, so that we can know how to
3438 // load an error page. See didFailProvisionalLoad. 3456 // load an error page. See didFailProvisionalLoad.
3439 document_state->navigation_state()->set_transition_type( 3457 document_state->navigation_state()->set_transition_type(
3440 PAGE_TRANSITION_AUTO_SUBFRAME); 3458 PAGE_TRANSITION_AUTO_SUBFRAME);
3441 } 3459 }
3442 3460
3443 FOR_EACH_OBSERVER( 3461 FOR_EACH_OBSERVER(
(...skipping 3246 matching lines...) Expand 10 before | Expand all | Expand 10 after
6690 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); 6708 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle);
6691 RenderProcess::current()->ReleaseTransportDIB(dib); 6709 RenderProcess::current()->ReleaseTransportDIB(dib);
6692 } 6710 }
6693 6711
6694 void RenderViewImpl::DidCommitCompositorFrame() { 6712 void RenderViewImpl::DidCommitCompositorFrame() {
6695 RenderWidget::DidCommitCompositorFrame(); 6713 RenderWidget::DidCommitCompositorFrame();
6696 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame()); 6714 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame());
6697 } 6715 }
6698 6716
6699 } // namespace content 6717 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698