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

Unified Diff: ios/web/navigation/crw_session_controller.mm

Issue 2711733007: Revert of (Set)IsOverridingUserAgent should be called on VisibleItem (Closed)
Patch Set: Created 3 years, 10 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 | « ios/chrome/browser/ui/browser_view_controller.mm ('k') | ios/web/web_state/ui/crw_web_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/navigation/crw_session_controller.mm
diff --git a/ios/web/navigation/crw_session_controller.mm b/ios/web/navigation/crw_session_controller.mm
index 7f7eec763044f42cc71f4adbadc558bfcb7f17de..d03bf9481386425669ff7c8f9bbaf4f29a8a8796 100644
--- a/ios/web/navigation/crw_session_controller.mm
+++ b/ios/web/navigation/crw_session_controller.mm
@@ -73,6 +73,10 @@
// The timestamp of the last time this tab is visited, represented in time
// interval since 1970.
NSTimeInterval _lastVisitedTimestamp;
+
+ // If |YES|, override |currentEntry.useDesktopUserAgent| and create the
+ // pending entry using the desktop user agent.
+ BOOL _useDesktopUserAgentForNextPendingItem;
// The browser state associated with this CRWSessionController;
web::BrowserState* _browserState; // weak
@@ -492,14 +496,11 @@
transition:(ui::PageTransition)transition {
DCHECK(![self pendingEntry]);
DCHECK([self currentEntry]);
-
- web::NavigationItem* lastCommittedItem =
- self.lastCommittedEntry.navigationItem;
+ web::NavigationItem* currentItem = [self currentEntry].navigationItem;
CHECK(web::history_state_util::IsHistoryStateChangeValid(
- lastCommittedItem->GetURL(), URL));
-
- web::Referrer referrer(lastCommittedItem->GetURL(),
- web::ReferrerPolicyDefault);
+ currentItem->GetURL(), URL));
+ web::Referrer referrer(currentItem->GetURL(), web::ReferrerPolicyDefault);
+
base::scoped_nsobject<CRWSessionEntry> pushedEntry([self
sessionEntryWithURL:URL
referrer:referrer
@@ -507,11 +508,11 @@
initiationType:web::NavigationInitiationType::USER_INITIATED]);
web::NavigationItemImpl* pushedItem = [pushedEntry navigationItemImpl];
- pushedItem->SetIsOverridingUserAgent(
- lastCommittedItem->IsOverridingUserAgent());
+ pushedItem->SetIsOverridingUserAgent(currentItem->IsOverridingUserAgent());
pushedItem->SetSerializedStateObject(stateObject);
pushedItem->SetIsCreatedFromPushState(true);
- pushedItem->GetSSL() = lastCommittedItem->GetSSL();
+ web::SSLStatus& sslStatus = [self currentEntry].navigationItem->GetSSL();
+ pushedEntry.get().navigationItem->GetSSL() = sslStatus;
[self clearForwardItems];
// Add the new entry at the end.
« no previous file with comments | « ios/chrome/browser/ui/browser_view_controller.mm ('k') | ios/web/web_state/ui/crw_web_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698