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

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: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/public/renderer/document_state.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 // 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 3339 matching lines...) Expand 10 before | Expand all | Expand 10 after
3350 } 3350 }
3351 3351
3352 // Start time is only set after request time. 3352 // Start time is only set after request time.
3353 document_state->set_start_load_time(Time::Now()); 3353 document_state->set_start_load_time(Time::Now());
3354 3354
3355 bool is_top_most = !frame->parent(); 3355 bool is_top_most = !frame->parent();
3356 if (is_top_most) { 3356 if (is_top_most) {
3357 navigation_gesture_ = WebUserGestureIndicator::isProcessingUserGesture() ? 3357 navigation_gesture_ = WebUserGestureIndicator::isProcessingUserGesture() ?
3358 NavigationGestureUser : NavigationGestureAuto; 3358 NavigationGestureUser : NavigationGestureAuto;
3359 3359
3360 // If the navigation is not triggered by a user gesture, e.g. by some ajax
3361 // callback, then inherit the submitted password form from the previous
3362 // state. This fixes the no password save issue for ajax login, tracked in
3363 // [http://crbug/43219]. Note that there are still some sites that this
3364 // fails for because they use some element other than a submit button to
3365 // trigger submission.
3366 if (navigation_gesture_ == NavigationGestureAuto) {
3367 DocumentState* old_document_state = DocumentState::FromDataSource(
3368 frame->dataSource());
3369 const content::PasswordForm* old_password_form =
3370 old_document_state->password_form_data();
3371 if (old_password_form) {
3372 document_state->set_password_form_data(
3373 make_scoped_ptr(new content::PasswordForm(*old_password_form)));
3374 }
3375 }
3376
3360 // Make sure redirect tracking state is clear for the new load. 3377 // Make sure redirect tracking state is clear for the new load.
3361 completed_client_redirect_src_ = Referrer(); 3378 completed_client_redirect_src_ = Referrer();
3362 } else if (frame->parent()->isLoading()) { 3379 } else if (frame->parent()->isLoading()) {
3363 // Take note of AUTO_SUBFRAME loads here, so that we can know how to 3380 // Take note of AUTO_SUBFRAME loads here, so that we can know how to
3364 // load an error page. See didFailProvisionalLoad. 3381 // load an error page. See didFailProvisionalLoad.
3365 document_state->navigation_state()->set_transition_type( 3382 document_state->navigation_state()->set_transition_type(
3366 PAGE_TRANSITION_AUTO_SUBFRAME); 3383 PAGE_TRANSITION_AUTO_SUBFRAME);
3367 } 3384 }
3368 3385
3369 FOR_EACH_OBSERVER( 3386 FOR_EACH_OBSERVER(
(...skipping 3162 matching lines...) Expand 10 before | Expand all | Expand 10 after
6532 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); 6549 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle);
6533 RenderProcess::current()->ReleaseTransportDIB(dib); 6550 RenderProcess::current()->ReleaseTransportDIB(dib);
6534 } 6551 }
6535 6552
6536 void RenderViewImpl::DidCommitCompositorFrame() { 6553 void RenderViewImpl::DidCommitCompositorFrame() {
6537 RenderWidget::DidCommitCompositorFrame(); 6554 RenderWidget::DidCommitCompositorFrame();
6538 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame()); 6555 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame());
6539 } 6556 }
6540 6557
6541 } // namespace content 6558 } // namespace content
OLDNEW
« 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