| 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 3328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3339 } | 3339 } |
| 3340 | 3340 |
| 3341 // Start time is only set after request time. | 3341 // Start time is only set after request time. |
| 3342 document_state->set_start_load_time(Time::Now()); | 3342 document_state->set_start_load_time(Time::Now()); |
| 3343 | 3343 |
| 3344 bool is_top_most = !frame->parent(); | 3344 bool is_top_most = !frame->parent(); |
| 3345 if (is_top_most) { | 3345 if (is_top_most) { |
| 3346 navigation_gesture_ = WebUserGestureIndicator::isProcessingUserGesture() ? | 3346 navigation_gesture_ = WebUserGestureIndicator::isProcessingUserGesture() ? |
| 3347 NavigationGestureUser : NavigationGestureAuto; | 3347 NavigationGestureUser : NavigationGestureAuto; |
| 3348 | 3348 |
| 3349 // If the navigation is not triggered by a user gesture, e.g. by some ajax |
| 3350 // callback, then inherit the submitted password form from the previous |
| 3351 // state. This fixes the no password save issue for ajax login, tracked in |
| 3352 // [http://crbug/43219]. Note that there are still some sites that this |
| 3353 // fails for because they use some element other than a submit button to |
| 3354 // trigger submission. |
| 3355 if (navigation_gesture_ == NavigationGestureAuto) { |
| 3356 DocumentState* document_state_old = DocumentState::FromDataSource( |
| 3357 frame->dataSource()); |
| 3358 const content::PasswordForm* password_form_old = |
| 3359 document_state_old->password_form_data(); |
| 3360 if (password_form_old) { |
| 3361 document_state->set_password_form_data( |
| 3362 make_scoped_ptr(new content::PasswordForm(*password_form_old))); |
| 3363 } |
| 3364 } |
| 3365 |
| 3349 // Make sure redirect tracking state is clear for the new load. | 3366 // Make sure redirect tracking state is clear for the new load. |
| 3350 completed_client_redirect_src_ = Referrer(); | 3367 completed_client_redirect_src_ = Referrer(); |
| 3351 } else if (frame->parent()->isLoading()) { | 3368 } else if (frame->parent()->isLoading()) { |
| 3352 // Take note of AUTO_SUBFRAME loads here, so that we can know how to | 3369 // Take note of AUTO_SUBFRAME loads here, so that we can know how to |
| 3353 // load an error page. See didFailProvisionalLoad. | 3370 // load an error page. See didFailProvisionalLoad. |
| 3354 document_state->navigation_state()->set_transition_type( | 3371 document_state->navigation_state()->set_transition_type( |
| 3355 PAGE_TRANSITION_AUTO_SUBFRAME); | 3372 PAGE_TRANSITION_AUTO_SUBFRAME); |
| 3356 } | 3373 } |
| 3357 | 3374 |
| 3358 FOR_EACH_OBSERVER( | 3375 FOR_EACH_OBSERVER( |
| (...skipping 3160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6519 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); | 6536 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); |
| 6520 RenderProcess::current()->ReleaseTransportDIB(dib); | 6537 RenderProcess::current()->ReleaseTransportDIB(dib); |
| 6521 } | 6538 } |
| 6522 | 6539 |
| 6523 void RenderViewImpl::DidCommitCompositorFrame() { | 6540 void RenderViewImpl::DidCommitCompositorFrame() { |
| 6524 RenderWidget::DidCommitCompositorFrame(); | 6541 RenderWidget::DidCommitCompositorFrame(); |
| 6525 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame()); | 6542 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame()); |
| 6526 } | 6543 } |
| 6527 | 6544 |
| 6528 } // namespace content | 6545 } // namespace content |
| OLD | NEW |