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 <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/ios/block_types.h" | 10 #include "base/ios/block_types.h" |
(...skipping 2723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2734 // documentURL and navigation URL. This heuristic may have false positives. | 2734 // documentURL and navigation URL. This heuristic may have false positives. |
2735 bool shouldAbortLoad = targetFrame ? targetFrame->is_main_frame | 2735 bool shouldAbortLoad = targetFrame ? targetFrame->is_main_frame |
2736 : requestURL == mainDocumentURL; | 2736 : requestURL == mainDocumentURL; |
2737 if (shouldAbortLoad) | 2737 if (shouldAbortLoad) |
2738 [self abortLoad]; | 2738 [self abortLoad]; |
2739 | 2739 |
2740 if ([_delegate openExternalURL:requestURL]) { | 2740 if ([_delegate openExternalURL:requestURL]) { |
2741 // Record the URL so that errors reported following the 'NO' reply can be | 2741 // Record the URL so that errors reported following the 'NO' reply can be |
2742 // safely ignored. | 2742 // safely ignored. |
2743 [_openedApplicationURL addObject:request.URL]; | 2743 [_openedApplicationURL addObject:request.URL]; |
2744 return NO; | 2744 if ([self cancellable]) |
| 2745 [_delegate webPageOrderedClose]; |
2745 } | 2746 } |
2746 return NO; | 2747 return NO; |
2747 } | 2748 } |
2748 | 2749 |
2749 if ([[request HTTPMethod] isEqualToString:@"POST"]) { | 2750 if ([[request HTTPMethod] isEqualToString:@"POST"]) { |
2750 [self cachePOSTDataForRequest:request | 2751 [self cachePOSTDataForRequest:request |
2751 inSessionEntry:[self currentSessionEntry]]; | 2752 inSessionEntry:[self currentSessionEntry]]; |
2752 } | 2753 } |
2753 | 2754 |
2754 return YES; | 2755 return YES; |
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3698 if (!_externalRequest || !_externalRequest->window_name) | 3699 if (!_externalRequest || !_externalRequest->window_name) |
3699 return @""; | 3700 return @""; |
3700 return _externalRequest->window_name; | 3701 return _externalRequest->window_name; |
3701 } | 3702 } |
3702 | 3703 |
3703 - (void)resetExternalRequest { | 3704 - (void)resetExternalRequest { |
3704 _externalRequest.reset(); | 3705 _externalRequest.reset(); |
3705 } | 3706 } |
3706 | 3707 |
3707 @end | 3708 @end |
OLD | NEW |