Chromium Code Reviews| 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 /* | 5 /* |
| 6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
| 10 * | 10 * |
| (...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 796 | 796 |
| 797 bool NavigationControllerImpl::RendererDidNavigate( | 797 bool NavigationControllerImpl::RendererDidNavigate( |
| 798 RenderFrameHostImpl* rfh, | 798 RenderFrameHostImpl* rfh, |
| 799 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, | 799 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, |
| 800 LoadCommittedDetails* details, | 800 LoadCommittedDetails* details, |
| 801 bool is_navigation_within_page, | 801 bool is_navigation_within_page, |
| 802 NavigationHandleImpl* navigation_handle) { | 802 NavigationHandleImpl* navigation_handle) { |
| 803 is_initial_navigation_ = false; | 803 is_initial_navigation_ = false; |
| 804 | 804 |
| 805 // Save the previous state before we clobber it. | 805 // Save the previous state before we clobber it. |
| 806 bool overriding_user_agent_changed = false; | |
| 806 if (GetLastCommittedEntry()) { | 807 if (GetLastCommittedEntry()) { |
| 807 details->previous_url = GetLastCommittedEntry()->GetURL(); | 808 details->previous_url = GetLastCommittedEntry()->GetURL(); |
| 808 details->previous_entry_index = GetLastCommittedEntryIndex(); | 809 details->previous_entry_index = GetLastCommittedEntryIndex(); |
| 810 if (pending_entry_ && | |
| 811 pending_entry_->GetIsOverridingUserAgent() != | |
| 812 GetLastCommittedEntry()->GetIsOverridingUserAgent()) | |
| 813 overriding_user_agent_changed = true; | |
| 809 } else { | 814 } else { |
| 810 details->previous_url = GURL(); | 815 details->previous_url = GURL(); |
| 811 details->previous_entry_index = -1; | 816 details->previous_entry_index = -1; |
| 812 } | 817 } |
| 813 | 818 |
| 814 // If there is a pending entry at this point, it should have a SiteInstance, | 819 // If there is a pending entry at this point, it should have a SiteInstance, |
| 815 // except for restored entries. | 820 // except for restored entries. |
| 816 DCHECK(pending_entry_index_ == -1 || pending_entry_->site_instance() || | 821 DCHECK(pending_entry_index_ == -1 || pending_entry_->site_instance() || |
| 817 pending_entry_->restore_type() != RestoreType::NONE); | 822 pending_entry_->restore_type() != RestoreType::NONE); |
| 818 if (pending_entry_ && pending_entry_->restore_type() != RestoreType::NONE) { | 823 if (pending_entry_ && pending_entry_->restore_type() != RestoreType::NONE) { |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 946 // we do not grant this entry additional bindings if we come back to it. | 951 // we do not grant this entry additional bindings if we come back to it. |
| 947 active_entry->SetBindings(rfh->GetEnabledBindings()); | 952 active_entry->SetBindings(rfh->GetEnabledBindings()); |
| 948 | 953 |
| 949 // Now prep the rest of the details for the notification and broadcast. | 954 // Now prep the rest of the details for the notification and broadcast. |
| 950 details->entry = active_entry; | 955 details->entry = active_entry; |
| 951 details->is_main_frame = !rfh->GetParent(); | 956 details->is_main_frame = !rfh->GetParent(); |
| 952 details->http_status_code = params.http_status_code; | 957 details->http_status_code = params.http_status_code; |
| 953 | 958 |
| 954 NotifyNavigationEntryCommitted(details); | 959 NotifyNavigationEntryCommitted(details); |
| 955 | 960 |
| 961 if (overriding_user_agent_changed) | |
| 962 delegate_->UpdateOverridingUserAgent(); | |
|
nasko
2017/01/09 23:07:53
Technically this should only be called if we actua
aelias_OOO_until_Jul13
2017/01/09 23:10:52
Right. Could you give me a more concrete suggesti
nasko
2017/01/09 23:44:03
Yes. The switch statement on 850 calls a specific
aelias_OOO_until_Jul13
2017/01/10 01:17:43
OK, done. Note that I needed to change the underl
| |
| 963 | |
| 956 // Update the nav_entry_id for each RenderFrameHost in the tree, so that each | 964 // Update the nav_entry_id for each RenderFrameHost in the tree, so that each |
| 957 // one knows the latest NavigationEntry it is showing (whether it has | 965 // one knows the latest NavigationEntry it is showing (whether it has |
| 958 // committed anything in this navigation or not). This allows things like | 966 // committed anything in this navigation or not). This allows things like |
| 959 // state and title updates from RenderFrames to apply to the latest relevant | 967 // state and title updates from RenderFrames to apply to the latest relevant |
| 960 // NavigationEntry. | 968 // NavigationEntry. |
| 961 int nav_entry_id = active_entry->GetUniqueID(); | 969 int nav_entry_id = active_entry->GetUniqueID(); |
| 962 for (FrameTreeNode* node : delegate_->GetFrameTree()->Nodes()) | 970 for (FrameTreeNode* node : delegate_->GetFrameTree()->Nodes()) |
| 963 node->current_frame_host()->set_nav_entry_id(nav_entry_id); | 971 node->current_frame_host()->set_nav_entry_id(nav_entry_id); |
| 964 return true; | 972 return true; |
| 965 } | 973 } |
| (...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2153 } | 2161 } |
| 2154 } | 2162 } |
| 2155 } | 2163 } |
| 2156 | 2164 |
| 2157 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 2165 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
| 2158 const base::Callback<base::Time()>& get_timestamp_callback) { | 2166 const base::Callback<base::Time()>& get_timestamp_callback) { |
| 2159 get_timestamp_callback_ = get_timestamp_callback; | 2167 get_timestamp_callback_ = get_timestamp_callback; |
| 2160 } | 2168 } |
| 2161 | 2169 |
| 2162 } // namespace content | 2170 } // namespace content |
| OLD | NEW |