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

Unified Diff: ios/web/web_state/ui/crw_web_controller.mm

Issue 2896623003: Added web::NavigationContext::GetPageTransition. (Closed)
Patch Set: Rebased Created 3 years, 7 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
Index: ios/web/web_state/ui/crw_web_controller.mm
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm
index 77d6a76735f86ed0550f1ef40be365f3e6f0d4d1..a47f2f09c0313b26aee3637519152d132ccf324f 100644
--- a/ios/web/web_state/ui/crw_web_controller.mm
+++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -1340,7 +1340,7 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
transition:(ui::PageTransition)transition {
std::unique_ptr<web::NavigationContextImpl> context =
web::NavigationContextImpl::CreateNavigationContext(_webStateImpl,
- pageURL);
+ pageURL, transition);
_webStateImpl->OnNavigationStarted(context.get());
[[self sessionController] pushNewItemWithURL:pageURL
stateObject:stateObject
@@ -1353,8 +1353,9 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
- (void)replaceStateWithPageURL:(const GURL&)pageURL
stateObject:(NSString*)stateObject {
std::unique_ptr<web::NavigationContextImpl> context =
- web::NavigationContextImpl::CreateNavigationContext(_webStateImpl,
- pageURL);
+ web::NavigationContextImpl::CreateNavigationContext(
+ _webStateImpl, pageURL,
+ ui::PageTransition::PAGE_TRANSITION_CLIENT_REDIRECT);
_webStateImpl->OnNavigationStarted(context.get());
[[self sessionController] updateCurrentItemWithURL:pageURL
stateObject:stateObject];
@@ -1529,8 +1530,8 @@ registerLoadRequestForURL:(const GURL&)requestURL
web::NavigationManager::UserAgentOverrideOption::INHERIT);
}
std::unique_ptr<web::NavigationContextImpl> context =
- web::NavigationContextImpl::CreateNavigationContext(_webStateImpl,
- requestURL);
+ web::NavigationContextImpl::CreateNavigationContext(
+ _webStateImpl, requestURL, transition);
web::NavigationItem* item = self.navigationManagerImpl->GetPendingItem();
// TODO(crbug.com/676129): AddPendingItem does not always create a pending
@@ -4176,17 +4177,18 @@ registerLoadRequestForURL:(const GURL&)requestURL
[_navigationStates setState:web::WKNavigationState::REQUESTED
forNavigation:navigation];
std::unique_ptr<web::NavigationContextImpl> context;
+ const ui::PageTransition loadHTMLTransition =
+ ui::PageTransition::PAGE_TRANSITION_TYPED;
if (_webStateImpl->HasWebUI()) {
// WebUI uses |loadHTML:forURL:| to feed the content to web view. This
// should not be treated as a navigation, but WKNavigationDelegate callbacks
// still expect a valid context.
- context =
- web::NavigationContextImpl::CreateNavigationContext(_webStateImpl, URL);
+ context = web::NavigationContextImpl::CreateNavigationContext(
+ _webStateImpl, URL, loadHTMLTransition);
} else {
- context = [self
- registerLoadRequestForURL:URL
- referrer:web::Referrer()
- transition:ui::PageTransition::PAGE_TRANSITION_TYPED];
+ context = [self registerLoadRequestForURL:URL
+ referrer:web::Referrer()
+ transition:loadHTMLTransition];
}
[_navigationStates setContext:std::move(context) forNavigation:navigation];
}
« no previous file with comments | « ios/web/web_state/navigation_context_impl_unittest.mm ('k') | ios/web/web_state/ui/crw_wk_navigation_states_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698