Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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* document_state_old = DocumentState::FromDataSource( | |
|
Charlie Reis
2013/03/27 05:15:04
nit: old_document_state (more consistent with othe
Garrett Casto
2013/03/27 18:59:44
Done.
| |
| 3368 frame->dataSource()); | |
| 3369 const content::PasswordForm* password_form_old = | |
|
Charlie Reis
2013/03/27 05:15:04
nit: old_password_form
Garrett Casto
2013/03/27 18:59:44
Done.
| |
| 3370 document_state_old->password_form_data(); | |
| 3371 if (password_form_old) { | |
| 3372 document_state->set_password_form_data( | |
| 3373 make_scoped_ptr(new content::PasswordForm(*password_form_old))); | |
| 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 Loading... | |
| 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 |
| OLD | NEW |