| 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 2191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2202 NOTREACHED(); | 2202 NOTREACHED(); |
| 2203 return; | 2203 return; |
| 2204 } | 2204 } |
| 2205 | 2205 |
| 2206 if (!_webStateImpl->IsShowingWebInterstitial()) | 2206 if (!_webStateImpl->IsShowingWebInterstitial()) |
| 2207 [self recordStateInHistory]; | 2207 [self recordStateInHistory]; |
| 2208 CRWSessionEntry* fromEntry = self.sessionController.currentEntry; | 2208 CRWSessionEntry* fromEntry = self.sessionController.currentEntry; |
| 2209 | 2209 |
| 2210 NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults]; | 2210 NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults]; |
| 2211 if (![userDefaults boolForKey:@"PendingIndexNavigationDisabled"]) { | 2211 if (![userDefaults boolForKey:@"PendingIndexNavigationDisabled"]) { |
| 2212 BOOL sameDocumentNavigation = | 2212 [self clearTransientContentView]; |
| 2213 [sessionController isSameDocumentNavigationBetweenEntry:fromEntry | 2213 |
| 2214 andEntry:entries[index]]; | 2214 BOOL sameDocumentNavigation = [sessionController |
| 2215 isSameDocumentNavigationBetweenItem:fromEntry.navigationItem |
| 2216 andItem:toEntry.navigationItem]; |
| 2215 if (sameDocumentNavigation) { | 2217 if (sameDocumentNavigation) { |
| 2216 [self.sessionController goToEntryAtIndex:index]; | 2218 [self.sessionController goToEntryAtIndex:index]; |
| 2217 | 2219 |
| 2218 // Implementation of |webWillFinishHistoryNavigationFromEntry:| expects | 2220 // Implementation of |webWillFinishHistoryNavigationFromEntry:| expects |
| 2219 // that NavigationManager has either a pending item or already made the | 2221 // that NavigationManager has either a pending item or already made the |
| 2220 // navigation. Hence this delegate must be called after changing current | 2222 // navigation. Hence this delegate must be called after changing current |
| 2221 // navigation item. TODO(crbug.com/670149): Remove this delegate method as | 2223 // navigation item. TODO(crbug.com/670149): Remove this delegate method as |
| 2222 // CRWWebController does not need to delegate setting Desktop User Agent. | 2224 // CRWWebController does not need to delegate setting Desktop User Agent. |
| 2223 [_delegate webWillFinishHistoryNavigationFromEntry:fromEntry]; | 2225 [_delegate webWillFinishHistoryNavigationFromEntry:fromEntry]; |
| 2224 [self updateHTML5HistoryState]; | 2226 [self updateHTML5HistoryState]; |
| (...skipping 3325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5550 } | 5552 } |
| 5551 | 5553 |
| 5552 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; | 5554 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; |
| 5553 } | 5555 } |
| 5554 | 5556 |
| 5555 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { | 5557 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { |
| 5556 return [action.request valueForHTTPHeaderField:@"Referer"]; | 5558 return [action.request valueForHTTPHeaderField:@"Referer"]; |
| 5557 } | 5559 } |
| 5558 | 5560 |
| 5559 @end | 5561 @end |
| OLD | NEW |