Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Unified Diff: ios/chrome/browser/tabs/tab.mm

Issue 2578173005: Add GetOriginalRequestURL() to NavigationItem interface. (Closed)
Patch Set: fix callers Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ios/web/navigation/crw_session_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/tabs/tab.mm
diff --git a/ios/chrome/browser/tabs/tab.mm b/ios/chrome/browser/tabs/tab.mm
index 06dab25ae5aa3f35e974aa12eb8873ab6fcdf92f..1fba38e5c36d224eaa909f6cf1bfee0449970cc4 100644
--- a/ios/chrome/browser/tabs/tab.mm
+++ b/ios/chrome/browser/tabs/tab.mm
@@ -1042,7 +1042,6 @@ - (void)addCurrentEntryToHistoryDB {
if (browserState_->IsOffTheRecord())
return;
- CRWSessionEntry* sessionEntry = self.currentSessionEntry;
web::NavigationItem* item = [self navigationManager]->GetVisibleItem();
// Do not update the history db for back/forward navigations.
@@ -1069,20 +1068,20 @@ - (void)addCurrentEntryToHistoryDB {
#endif
history::RedirectList redirects;
- if (item->GetURL() != sessionEntry.originalUrl) {
+ GURL originalURL = item->GetOriginalRequestURL();
+ if (item->GetURL() != originalURL) {
// Simulate a valid redirect chain in case of URL that have been modified
// in |CRWWebController finishHistoryNavigationFromEntry:|.
const std::string& urlSpec = item->GetURL().spec();
size_t urlSpecLength = urlSpec.size();
if (item->GetTransitionType() & ui::PAGE_TRANSITION_CLIENT_REDIRECT ||
(urlSpecLength && (urlSpec.at(urlSpecLength - 1) == '#') &&
- !urlSpec.compare(0, urlSpecLength - 1,
- sessionEntry.originalUrl.spec()))) {
+ !urlSpec.compare(0, urlSpecLength - 1, originalURL.spec()))) {
redirects.push_back(referrer.url);
}
// TODO(crbug.com/661670): the redirect chain is not constructed the same
// way as upstream so this part needs to be revised.
- redirects.push_back(sessionEntry.originalUrl);
+ redirects.push_back(originalURL);
redirects.push_back(url);
}
@@ -1606,7 +1605,7 @@ - (void)reloadForDesktopUserAgent {
return;
// |originalUrl| will be empty if a page was open by DOM.
- GURL reloadURL(lastUserEntry.originalUrl);
+ GURL reloadURL(lastUserEntry.navigationItem->GetOriginalRequestURL());
if (reloadURL.is_empty()) {
DCHECK(sessionController.openedByDOM);
reloadURL = [lastUserEntry navigationItem]->GetVirtualURL();
« no previous file with comments | « no previous file | ios/web/navigation/crw_session_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698