| 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 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1332 // re-sent when replaying the entry. | 1332 // re-sent when replaying the entry. |
| 1333 // TODO(stuartmorgan): When possible, get the real referrer and policy in | 1333 // TODO(stuartmorgan): When possible, get the real referrer and policy in |
| 1334 // advance and use that instead. https://crbug.com/227769. | 1334 // advance and use that instead. https://crbug.com/227769. |
| 1335 return web::Referrer(GURL(base::SysNSStringToUTF8(referrerString)), | 1335 return web::Referrer(GURL(base::SysNSStringToUTF8(referrerString)), |
| 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 [[self sessionController] pushNewItemWithURL:pageURL | 1343 [[self sessionController] pushNewItemWithURL:pageURL |
| 1343 stateObject:stateObject | 1344 stateObject:stateObject |
| 1344 transition:transition]; | 1345 transition:transition]; |
| 1345 std::unique_ptr<web::NavigationContext> context = | 1346 std::unique_ptr<web::NavigationContext> context = |
| 1346 web::NavigationContextImpl::CreateSameDocumentNavigationContext( | 1347 web::NavigationContextImpl::CreateSameDocumentNavigationContext( |
| 1347 _webStateImpl, pageURL); | 1348 _webStateImpl, pageURL); |
| 1348 _webStateImpl->OnNavigationFinished(context.get()); | 1349 _webStateImpl->OnNavigationFinished(context.get()); |
| 1349 self.userInteractionRegistered = NO; | 1350 self.userInteractionRegistered = NO; |
| 1350 } | 1351 } |
| 1351 | 1352 |
| 1352 - (void)replaceStateWithPageURL:(const GURL&)pageURL | 1353 - (void)replaceStateWithPageURL:(const GURL&)pageURL |
| 1353 stateObject:(NSString*)stateObject { | 1354 stateObject:(NSString*)stateObject { |
| 1355 _webStateImpl->OnProvisionalNavigationStarted(pageURL); |
| 1354 [[self sessionController] updateCurrentItemWithURL:pageURL | 1356 [[self sessionController] updateCurrentItemWithURL:pageURL |
| 1355 stateObject:stateObject]; | 1357 stateObject:stateObject]; |
| 1356 std::unique_ptr<web::NavigationContext> context = | 1358 std::unique_ptr<web::NavigationContext> context = |
| 1357 web::NavigationContextImpl::CreateSameDocumentNavigationContext( | 1359 web::NavigationContextImpl::CreateSameDocumentNavigationContext( |
| 1358 _webStateImpl, pageURL); | 1360 _webStateImpl, pageURL); |
| 1359 _webStateImpl->OnNavigationFinished(context.get()); | 1361 _webStateImpl->OnNavigationFinished(context.get()); |
| 1360 } | 1362 } |
| 1361 | 1363 |
| 1362 - (void)setDocumentURL:(const GURL&)newURL { | 1364 - (void)setDocumentURL:(const GURL&)newURL { |
| 1363 if (newURL != _documentURL && newURL.is_valid()) { | 1365 if (newURL != _documentURL && newURL.is_valid()) { |
| (...skipping 3793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5157 - (NSUInteger)observerCount { | 5159 - (NSUInteger)observerCount { |
| 5158 DCHECK_EQ(_observerBridges.size(), [_observers count]); | 5160 DCHECK_EQ(_observerBridges.size(), [_observers count]); |
| 5159 return [_observers count]; | 5161 return [_observers count]; |
| 5160 } | 5162 } |
| 5161 | 5163 |
| 5162 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action { | 5164 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action { |
| 5163 return [action.request valueForHTTPHeaderField:kReferrerHeaderName]; | 5165 return [action.request valueForHTTPHeaderField:kReferrerHeaderName]; |
| 5164 } | 5166 } |
| 5165 | 5167 |
| 5166 @end | 5168 @end |
| OLD | NEW |