| 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 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1106 // the URL. | 1106 // the URL. |
| 1107 update_virtual_url = needs_update; | 1107 update_virtual_url = needs_update; |
| 1108 } | 1108 } |
| 1109 | 1109 |
| 1110 // Don't use the page type from the pending entry. Some interstitial page | 1110 // Don't use the page type from the pending entry. Some interstitial page |
| 1111 // may have set the type to interstitial. Once we commit, however, the page | 1111 // may have set the type to interstitial. Once we commit, however, the page |
| 1112 // type must always be normal or error. | 1112 // type must always be normal or error. |
| 1113 new_entry->set_page_type(params.url_is_unreachable ? PAGE_TYPE_ERROR | 1113 new_entry->set_page_type(params.url_is_unreachable ? PAGE_TYPE_ERROR |
| 1114 : PAGE_TYPE_NORMAL); | 1114 : PAGE_TYPE_NORMAL); |
| 1115 new_entry->SetURL(params.url); | 1115 new_entry->SetURL(params.url); |
| 1116 new_entry->SetOrigin(url::Origin(params.url)); |
| 1116 if (update_virtual_url) | 1117 if (update_virtual_url) |
| 1117 UpdateVirtualURLToURL(new_entry.get(), params.url); | 1118 UpdateVirtualURLToURL(new_entry.get(), params.url); |
| 1118 new_entry->SetReferrer(params.referrer); | 1119 new_entry->SetReferrer(params.referrer); |
| 1119 new_entry->SetPageID(params.page_id); | 1120 new_entry->SetPageID(params.page_id); |
| 1120 new_entry->SetTransitionType(params.transition); | 1121 new_entry->SetTransitionType(params.transition); |
| 1121 new_entry->set_site_instance( | 1122 new_entry->set_site_instance( |
| 1122 static_cast<SiteInstanceImpl*>(rfh->GetSiteInstance())); | 1123 static_cast<SiteInstanceImpl*>(rfh->GetSiteInstance())); |
| 1123 new_entry->SetHasPostData(params.is_post); | 1124 new_entry->SetHasPostData(params.is_post); |
| 1124 new_entry->SetPostID(params.post_id); | 1125 new_entry->SetPostID(params.post_id); |
| 1125 new_entry->SetOriginalRequestURL(params.original_request_url); | 1126 new_entry->SetOriginalRequestURL(params.original_request_url); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1173 // navigations that are EXISTING_PAGE are reloads and location.replace, | 1174 // navigations that are EXISTING_PAGE are reloads and location.replace, |
| 1174 // which land us at the last committed entry. | 1175 // which land us at the last committed entry. |
| 1175 entry = GetLastCommittedEntry(); | 1176 entry = GetLastCommittedEntry(); |
| 1176 } | 1177 } |
| 1177 DCHECK(entry); | 1178 DCHECK(entry); |
| 1178 | 1179 |
| 1179 // The URL may have changed due to redirects. | 1180 // The URL may have changed due to redirects. |
| 1180 entry->set_page_type(params.url_is_unreachable ? PAGE_TYPE_ERROR | 1181 entry->set_page_type(params.url_is_unreachable ? PAGE_TYPE_ERROR |
| 1181 : PAGE_TYPE_NORMAL); | 1182 : PAGE_TYPE_NORMAL); |
| 1182 entry->SetURL(params.url); | 1183 entry->SetURL(params.url); |
| 1184 entry->SetOrigin(url::Origin(params.url)); |
| 1183 entry->SetReferrer(params.referrer); | 1185 entry->SetReferrer(params.referrer); |
| 1184 if (entry->update_virtual_url_with_url()) | 1186 if (entry->update_virtual_url_with_url()) |
| 1185 UpdateVirtualURLToURL(entry, params.url); | 1187 UpdateVirtualURLToURL(entry, params.url); |
| 1186 | 1188 |
| 1187 // The redirected to page should not inherit the favicon from the previous | 1189 // The redirected to page should not inherit the favicon from the previous |
| 1188 // page. | 1190 // page. |
| 1189 if (ui::PageTransitionIsRedirect(params.transition)) | 1191 if (ui::PageTransitionIsRedirect(params.transition)) |
| 1190 entry->GetFavicon() = FaviconStatus(); | 1192 entry->GetFavicon() = FaviconStatus(); |
| 1191 | 1193 |
| 1192 // The site instance will normally be the same except during session restore, | 1194 // The site instance will normally be the same except during session restore, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1231 // a regular user-initiated navigation. | 1233 // a regular user-initiated navigation. |
| 1232 DCHECK_EQ(pending_entry_->GetUniqueID(), params.nav_entry_id); | 1234 DCHECK_EQ(pending_entry_->GetUniqueID(), params.nav_entry_id); |
| 1233 existing_entry->set_unique_id(pending_entry_->GetUniqueID()); | 1235 existing_entry->set_unique_id(pending_entry_->GetUniqueID()); |
| 1234 | 1236 |
| 1235 // The URL may have changed due to redirects. | 1237 // The URL may have changed due to redirects. |
| 1236 existing_entry->set_page_type(params.url_is_unreachable ? PAGE_TYPE_ERROR | 1238 existing_entry->set_page_type(params.url_is_unreachable ? PAGE_TYPE_ERROR |
| 1237 : PAGE_TYPE_NORMAL); | 1239 : PAGE_TYPE_NORMAL); |
| 1238 if (existing_entry->update_virtual_url_with_url()) | 1240 if (existing_entry->update_virtual_url_with_url()) |
| 1239 UpdateVirtualURLToURL(existing_entry, params.url); | 1241 UpdateVirtualURLToURL(existing_entry, params.url); |
| 1240 existing_entry->SetURL(params.url); | 1242 existing_entry->SetURL(params.url); |
| 1243 existing_entry->SetOrigin(url::Origin(params.url)); |
| 1241 existing_entry->SetReferrer(params.referrer); | 1244 existing_entry->SetReferrer(params.referrer); |
| 1242 | 1245 |
| 1243 // The page may have been requested with a different HTTP method. | 1246 // The page may have been requested with a different HTTP method. |
| 1244 existing_entry->SetHasPostData(params.is_post); | 1247 existing_entry->SetHasPostData(params.is_post); |
| 1245 existing_entry->SetPostID(params.post_id); | 1248 existing_entry->SetPostID(params.post_id); |
| 1246 | 1249 |
| 1247 DiscardNonCommittedEntries(); | 1250 DiscardNonCommittedEntries(); |
| 1248 } | 1251 } |
| 1249 | 1252 |
| 1250 void NavigationControllerImpl::RendererDidNavigateNewSubframe( | 1253 void NavigationControllerImpl::RendererDidNavigateNewSubframe( |
| (...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2041 } | 2044 } |
| 2042 } | 2045 } |
| 2043 } | 2046 } |
| 2044 | 2047 |
| 2045 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 2048 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
| 2046 const base::Callback<base::Time()>& get_timestamp_callback) { | 2049 const base::Callback<base::Time()>& get_timestamp_callback) { |
| 2047 get_timestamp_callback_ = get_timestamp_callback; | 2050 get_timestamp_callback_ = get_timestamp_callback; |
| 2048 } | 2051 } |
| 2049 | 2052 |
| 2050 } // namespace content | 2053 } // namespace content |
| OLD | NEW |