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

Side by Side Diff: ios/web/web_state/ui/crw_web_controller.mm

Issue 2718733003: Removed -[CRWWebDelegate webDidUpdateHistoryStateWithPageURL]. (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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 #import "ios/web/web_state/ui/crw_web_controller.h" 5 #import "ios/web/web_state/ui/crw_web_controller.h"
6 6
7 #import <WebKit/WebKit.h> 7 #import <WebKit/WebKit.h>
8 8
9 #import <objc/runtime.h> 9 #import <objc/runtime.h>
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 - (BOOL)urlTriggersNativeAppLaunch:(const GURL&)URL 739 - (BOOL)urlTriggersNativeAppLaunch:(const GURL&)URL
740 sourceURL:(const GURL&)sourceURL 740 sourceURL:(const GURL&)sourceURL
741 linkActivatedNavigation:(BOOL)linkActivatedNavigation; 741 linkActivatedNavigation:(BOOL)linkActivatedNavigation;
742 // Called when a JavaScript dialog, HTTP authentication dialog or window.open 742 // Called when a JavaScript dialog, HTTP authentication dialog or window.open
743 // call has been suppressed. 743 // call has been suppressed.
744 - (void)didSuppressDialog; 744 - (void)didSuppressDialog;
745 // Returns YES if the navigation action is associated with a main frame request. 745 // Returns YES if the navigation action is associated with a main frame request.
746 - (BOOL)isMainFrameNavigationAction:(WKNavigationAction*)action; 746 - (BOOL)isMainFrameNavigationAction:(WKNavigationAction*)action;
747 // Returns whether external URL navigation action should be opened. 747 // Returns whether external URL navigation action should be opened.
748 - (BOOL)shouldOpenExternalURLForNavigationAction:(WKNavigationAction*)action; 748 - (BOOL)shouldOpenExternalURLForNavigationAction:(WKNavigationAction*)action;
749 // Called when a page updates its history stack using pushState or replaceState.
750 - (void)didUpdateHistoryStateWithPageURL:(const GURL&)url;
751 // Updates SSL status for the current navigation item based on the information 749 // Updates SSL status for the current navigation item based on the information
752 // provided by web view. 750 // provided by web view.
753 - (void)updateSSLStatusForCurrentNavigationItem; 751 - (void)updateSSLStatusForCurrentNavigationItem;
754 // Called when SSL status has been updated for the current navigation item. 752 // Called when SSL status has been updated for the current navigation item.
755 - (void)didUpdateSSLStatusForCurrentNavigationItem; 753 - (void)didUpdateSSLStatusForCurrentNavigationItem;
756 // Called when a load ends in an SSL error and certificate chain. 754 // Called when a load ends in an SSL error and certificate chain.
757 - (void)handleSSLCertError:(NSError*)error; 755 - (void)handleSSLCertError:(NSError*)error;
758 756
759 // Used in webView:didReceiveAuthenticationChallenge:completionHandler: to 757 // Used in webView:didReceiveAuthenticationChallenge:completionHandler: to
760 // reply with NSURLSessionAuthChallengeDisposition and credentials. 758 // reply with NSURLSessionAuthChallengeDisposition and credentials.
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
1334 return web::Referrer(GURL(base::SysNSStringToUTF8(referrerString)), 1332 return web::Referrer(GURL(base::SysNSStringToUTF8(referrerString)),
1335 web::ReferrerPolicyAlways); 1333 web::ReferrerPolicyAlways);
1336 } 1334 }
1337 1335
1338 - (void)pushStateWithPageURL:(const GURL&)pageURL 1336 - (void)pushStateWithPageURL:(const GURL&)pageURL
1339 stateObject:(NSString*)stateObject 1337 stateObject:(NSString*)stateObject
1340 transition:(ui::PageTransition)transition { 1338 transition:(ui::PageTransition)transition {
1341 [[self sessionController] pushNewItemWithURL:pageURL 1339 [[self sessionController] pushNewItemWithURL:pageURL
1342 stateObject:stateObject 1340 stateObject:stateObject
1343 transition:transition]; 1341 transition:transition];
1344 [self didUpdateHistoryStateWithPageURL:pageURL]; 1342 _webStateImpl->OnSamePageNavigation(pageURL);
1345 self.userInteractionRegistered = NO; 1343 self.userInteractionRegistered = NO;
1346 } 1344 }
1347 1345
1348 - (void)replaceStateWithPageURL:(const GURL&)pageUrl 1346 - (void)replaceStateWithPageURL:(const GURL&)pageURL
1349 stateObject:(NSString*)stateObject { 1347 stateObject:(NSString*)stateObject {
1350 [[self sessionController] updateCurrentItemWithURL:pageUrl 1348 [[self sessionController] updateCurrentItemWithURL:pageURL
1351 stateObject:stateObject]; 1349 stateObject:stateObject];
1352 [self didUpdateHistoryStateWithPageURL:pageUrl]; 1350 _webStateImpl->OnSamePageNavigation(pageURL);
1353 } 1351 }
1354 1352
1355 - (void)setDocumentURL:(const GURL&)newURL { 1353 - (void)setDocumentURL:(const GURL&)newURL {
1356 if (newURL != _documentURL && newURL.is_valid()) { 1354 if (newURL != _documentURL && newURL.is_valid()) {
1357 _documentURL = newURL; 1355 _documentURL = newURL;
1358 _interactionRegisteredSinceLastURLChange = NO; 1356 _interactionRegisteredSinceLastURLChange = NO;
1359 } 1357 }
1360 } 1358 }
1361 1359
1362 - (void)setNavigationItemTitle:(NSString*)title { 1360 - (void)setNavigationItemTitle:(NSString*)title {
(...skipping 2673 matching lines...) Expand 10 before | Expand all | Expand 10 after
4036 sourceURL:sourceURL 4034 sourceURL:sourceURL
4037 linkClicked:linkActivatedNavigation]; 4035 linkClicked:linkActivatedNavigation];
4038 } 4036 }
4039 4037
4040 - (CGFloat)headerHeight { 4038 - (CGFloat)headerHeight {
4041 if (![_delegate respondsToSelector:@selector(headerHeightForWebController:)]) 4039 if (![_delegate respondsToSelector:@selector(headerHeightForWebController:)])
4042 return 0.0f; 4040 return 0.0f;
4043 return [_delegate headerHeightForWebController:self]; 4041 return [_delegate headerHeightForWebController:self];
4044 } 4042 }
4045 4043
4046 - (void)didUpdateHistoryStateWithPageURL:(const GURL&)url {
4047 _webStateImpl->OnSamePageNavigation(url);
4048 [_delegate webDidUpdateHistoryStateWithPageURL:url];
4049 }
4050
4051 - (void)updateSSLStatusForCurrentNavigationItem { 4044 - (void)updateSSLStatusForCurrentNavigationItem {
4052 if (_isBeingDestroyed) { 4045 if (_isBeingDestroyed) {
4053 return; 4046 return;
4054 } 4047 }
4055 4048
4056 web::NavigationManager* navManager = self.webState->GetNavigationManager(); 4049 web::NavigationManager* navManager = self.webState->GetNavigationManager();
4057 web::NavigationItem* currentNavItem = navManager->GetLastCommittedItem(); 4050 web::NavigationItem* currentNavItem = navManager->GetLastCommittedItem();
4058 if (!currentNavItem) { 4051 if (!currentNavItem) {
4059 return; 4052 return;
4060 } 4053 }
(...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after
5248 - (void)simulateLoadRequestWithURL:(const GURL&)URL { 5241 - (void)simulateLoadRequestWithURL:(const GURL&)URL {
5249 _lastRegisteredRequestURL = URL; 5242 _lastRegisteredRequestURL = URL;
5250 _loadPhase = web::LOAD_REQUESTED; 5243 _loadPhase = web::LOAD_REQUESTED;
5251 } 5244 }
5252 5245
5253 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action { 5246 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action {
5254 return [action.request valueForHTTPHeaderField:kReferrerHeaderName]; 5247 return [action.request valueForHTTPHeaderField:kReferrerHeaderName];
5255 } 5248 }
5256 5249
5257 @end 5250 @end
OLDNEW
« no previous file with comments | « ios/web/public/web_state/web_state_observer_bridge.h ('k') | ios/web/web_state/web_state_observer_bridge.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698