OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/browser/frame_host/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 3449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3460 if (pending_entry && pending_entry->GetUniqueID() == params.nav_entry_id) { | 3460 if (pending_entry && pending_entry->GetUniqueID() == params.nav_entry_id) { |
3461 pending_nav_entry_id = params.nav_entry_id; | 3461 pending_nav_entry_id = params.nav_entry_id; |
3462 is_renderer_initiated = pending_entry->is_renderer_initiated(); | 3462 is_renderer_initiated = pending_entry->is_renderer_initiated(); |
3463 } | 3463 } |
3464 | 3464 |
3465 return NavigationHandleImpl::Create( | 3465 return NavigationHandleImpl::Create( |
3466 params.url, params.redirects, frame_tree_node_, is_renderer_initiated, | 3466 params.url, params.redirects, frame_tree_node_, is_renderer_initiated, |
3467 params.was_within_same_page, base::TimeTicks::Now(), | 3467 params.was_within_same_page, base::TimeTicks::Now(), |
3468 pending_nav_entry_id, | 3468 pending_nav_entry_id, |
3469 false, // started_from_context_menu | 3469 false, // started_from_context_menu |
3470 false); // should_bypass_main_world_csp | 3470 false, // should_bypass_main_world_csp |
| 3471 false); // is_form_submission |
3471 } | 3472 } |
3472 | 3473 |
3473 // Determine if the current NavigationHandle can be used. | 3474 // Determine if the current NavigationHandle can be used. |
3474 if (navigation_handle_ && navigation_handle_->GetURL() == params.url) { | 3475 if (navigation_handle_ && navigation_handle_->GetURL() == params.url) { |
3475 return std::move(navigation_handle_); | 3476 return std::move(navigation_handle_); |
3476 } | 3477 } |
3477 | 3478 |
3478 // If the URL does not match what the NavigationHandle expects, treat the | 3479 // If the URL does not match what the NavigationHandle expects, treat the |
3479 // commit as a new navigation. This can happen when loading a Data | 3480 // commit as a new navigation. This can happen when loading a Data |
3480 // navigation with LoadDataWithBaseURL. | 3481 // navigation with LoadDataWithBaseURL. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3514 } | 3515 } |
3515 | 3516 |
3516 // There is no pending NavigationEntry in these cases, so pass 0 as the | 3517 // There is no pending NavigationEntry in these cases, so pass 0 as the |
3517 // pending_nav_entry_id. If the previous handle was a prematurely aborted | 3518 // pending_nav_entry_id. If the previous handle was a prematurely aborted |
3518 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. | 3519 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. |
3519 return NavigationHandleImpl::Create( | 3520 return NavigationHandleImpl::Create( |
3520 params.url, params.redirects, frame_tree_node_, is_renderer_initiated, | 3521 params.url, params.redirects, frame_tree_node_, is_renderer_initiated, |
3521 params.was_within_same_page, base::TimeTicks::Now(), | 3522 params.was_within_same_page, base::TimeTicks::Now(), |
3522 entry_id_for_data_nav, | 3523 entry_id_for_data_nav, |
3523 false, // started_from_context_menu | 3524 false, // started_from_context_menu |
3524 false); // should_bypass_main_world_csp | 3525 false, // should_bypass_main_world_csp |
| 3526 false); // is_form_submission |
3525 } | 3527 } |
3526 | 3528 |
3527 #if defined(OS_ANDROID) | 3529 #if defined(OS_ANDROID) |
3528 base::android::ScopedJavaLocalRef<jobject> | 3530 base::android::ScopedJavaLocalRef<jobject> |
3529 RenderFrameHostImpl::GetJavaRenderFrameHost() { | 3531 RenderFrameHostImpl::GetJavaRenderFrameHost() { |
3530 RenderFrameHostAndroid* render_frame_host_android = | 3532 RenderFrameHostAndroid* render_frame_host_android = |
3531 static_cast<RenderFrameHostAndroid*>( | 3533 static_cast<RenderFrameHostAndroid*>( |
3532 GetUserData(kRenderFrameHostAndroidKey)); | 3534 GetUserData(kRenderFrameHostAndroidKey)); |
3533 if (!render_frame_host_android) { | 3535 if (!render_frame_host_android) { |
3534 render_frame_host_android = new RenderFrameHostAndroid(this); | 3536 render_frame_host_android = new RenderFrameHostAndroid(this); |
3535 SetUserData(kRenderFrameHostAndroidKey, render_frame_host_android); | 3537 SetUserData(kRenderFrameHostAndroidKey, render_frame_host_android); |
3536 } | 3538 } |
3537 return render_frame_host_android->GetJavaObject(); | 3539 return render_frame_host_android->GetJavaObject(); |
3538 } | 3540 } |
3539 #endif | 3541 #endif |
3540 | 3542 |
3541 } // namespace content | 3543 } // namespace content |
OLD | NEW |