| OLD | NEW |
| 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 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1336 web::ReferrerPolicyAlways); | 1336 web::ReferrerPolicyAlways); |
| 1337 } | 1337 } |
| 1338 | 1338 |
| 1339 - (void)pushStateWithPageURL:(const GURL&)pageURL | 1339 - (void)pushStateWithPageURL:(const GURL&)pageURL |
| 1340 stateObject:(NSString*)stateObject | 1340 stateObject:(NSString*)stateObject |
| 1341 transition:(ui::PageTransition)transition { | 1341 transition:(ui::PageTransition)transition { |
| 1342 _webStateImpl->OnProvisionalNavigationStarted(pageURL); | 1342 _webStateImpl->OnProvisionalNavigationStarted(pageURL); |
| 1343 [[self sessionController] pushNewItemWithURL:pageURL | 1343 [[self sessionController] pushNewItemWithURL:pageURL |
| 1344 stateObject:stateObject | 1344 stateObject:stateObject |
| 1345 transition:transition]; | 1345 transition:transition]; |
| 1346 std::unique_ptr<web::NavigationContext> context = | 1346 std::unique_ptr<web::NavigationContextImpl> context = |
| 1347 web::NavigationContextImpl::CreateSameDocumentNavigationContext( | 1347 web::NavigationContextImpl::CreateNavigationContext(_webStateImpl, |
| 1348 _webStateImpl, pageURL); | 1348 pageURL); |
| 1349 context->SetIsSameDocument(true); |
| 1349 _webStateImpl->OnNavigationFinished(context.get()); | 1350 _webStateImpl->OnNavigationFinished(context.get()); |
| 1350 self.userInteractionRegistered = NO; | 1351 self.userInteractionRegistered = NO; |
| 1351 } | 1352 } |
| 1352 | 1353 |
| 1353 - (void)replaceStateWithPageURL:(const GURL&)pageURL | 1354 - (void)replaceStateWithPageURL:(const GURL&)pageURL |
| 1354 stateObject:(NSString*)stateObject { | 1355 stateObject:(NSString*)stateObject { |
| 1355 _webStateImpl->OnProvisionalNavigationStarted(pageURL); | 1356 _webStateImpl->OnProvisionalNavigationStarted(pageURL); |
| 1356 [[self sessionController] updateCurrentItemWithURL:pageURL | 1357 [[self sessionController] updateCurrentItemWithURL:pageURL |
| 1357 stateObject:stateObject]; | 1358 stateObject:stateObject]; |
| 1358 std::unique_ptr<web::NavigationContext> context = | 1359 std::unique_ptr<web::NavigationContextImpl> context = |
| 1359 web::NavigationContextImpl::CreateSameDocumentNavigationContext( | 1360 web::NavigationContextImpl::CreateNavigationContext(_webStateImpl, |
| 1360 _webStateImpl, pageURL); | 1361 pageURL); |
| 1362 context->SetIsSameDocument(true); |
| 1361 _webStateImpl->OnNavigationFinished(context.get()); | 1363 _webStateImpl->OnNavigationFinished(context.get()); |
| 1362 } | 1364 } |
| 1363 | 1365 |
| 1364 - (void)setDocumentURL:(const GURL&)newURL { | 1366 - (void)setDocumentURL:(const GURL&)newURL { |
| 1365 if (newURL != _documentURL && newURL.is_valid()) { | 1367 if (newURL != _documentURL && newURL.is_valid()) { |
| 1366 _documentURL = newURL; | 1368 _documentURL = newURL; |
| 1367 _interactionRegisteredSinceLastURLChange = NO; | 1369 _interactionRegisteredSinceLastURLChange = NO; |
| 1368 } | 1370 } |
| 1369 } | 1371 } |
| 1370 | 1372 |
| (...skipping 3788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5159 - (NSUInteger)observerCount { | 5161 - (NSUInteger)observerCount { |
| 5160 DCHECK_EQ(_observerBridges.size(), [_observers count]); | 5162 DCHECK_EQ(_observerBridges.size(), [_observers count]); |
| 5161 return [_observers count]; | 5163 return [_observers count]; |
| 5162 } | 5164 } |
| 5163 | 5165 |
| 5164 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action { | 5166 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action { |
| 5165 return [action.request valueForHTTPHeaderField:kReferrerHeaderName]; | 5167 return [action.request valueForHTTPHeaderField:kReferrerHeaderName]; |
| 5166 } | 5168 } |
| 5167 | 5169 |
| 5168 @end | 5170 @end |
| OLD | NEW |