| 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 <objc/runtime.h> | 7 #import <objc/runtime.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 | 10 |
| (...skipping 2801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2812 // Record the URL so that errors reported following the 'NO' reply can be | 2812 // Record the URL so that errors reported following the 'NO' reply can be |
| 2813 // safely ignored. | 2813 // safely ignored. |
| 2814 [_openedApplicationURL addObject:request.URL]; | 2814 [_openedApplicationURL addObject:request.URL]; |
| 2815 if ([self shouldClosePageOnNativeApplicationLoad]) | 2815 if ([self shouldClosePageOnNativeApplicationLoad]) |
| 2816 [_delegate webPageOrderedClose]; | 2816 [_delegate webPageOrderedClose]; |
| 2817 } | 2817 } |
| 2818 return NO; | 2818 return NO; |
| 2819 } | 2819 } |
| 2820 | 2820 |
| 2821 if ([[request HTTPMethod] isEqualToString:@"POST"]) { | 2821 if ([[request HTTPMethod] isEqualToString:@"POST"]) { |
| 2822 [self cachePOSTDataForRequest:request | 2822 CRWSessionEntry* currentEntry = [self currentSessionEntry]; |
| 2823 inSessionEntry:[self currentSessionEntry]]; | 2823 // TODO(crbug.com/570699): Remove this check once it's no longer possible to |
| 2824 // have no current entries. |
| 2825 if (currentEntry) |
| 2826 [self cachePOSTDataForRequest:request inSessionEntry:currentEntry]; |
| 2824 } | 2827 } |
| 2825 | 2828 |
| 2826 return YES; | 2829 return YES; |
| 2827 } | 2830 } |
| 2828 | 2831 |
| 2829 - (void)restoreStateAfterURLRejection { | 2832 - (void)restoreStateAfterURLRejection { |
| 2830 [[self sessionController] discardNonCommittedEntries]; | 2833 [[self sessionController] discardNonCommittedEntries]; |
| 2831 | 2834 |
| 2832 // Reset |_lastRegisteredRequestURL| so that it reflects the URL from before | 2835 // Reset |_lastRegisteredRequestURL| so that it reflects the URL from before |
| 2833 // the load was rejected. This value may be out of sync because | 2836 // the load was rejected. This value may be out of sync because |
| (...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3895 if ([MIMEType isEqualToString:@"text/html"] || | 3898 if ([MIMEType isEqualToString:@"text/html"] || |
| 3896 [MIMEType isEqualToString:@"application/xhtml+xml"] || | 3899 [MIMEType isEqualToString:@"application/xhtml+xml"] || |
| 3897 [MIMEType isEqualToString:@"application/xml"]) { | 3900 [MIMEType isEqualToString:@"application/xml"]) { |
| 3898 return web::WEB_VIEW_DOCUMENT_TYPE_HTML; | 3901 return web::WEB_VIEW_DOCUMENT_TYPE_HTML; |
| 3899 } | 3902 } |
| 3900 | 3903 |
| 3901 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; | 3904 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; |
| 3902 } | 3905 } |
| 3903 | 3906 |
| 3904 @end | 3907 @end |
| OLD | NEW |