Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Side by Side Diff: ios/web/web_state/ui/crw_web_controller.mm

Issue 1146133005: Close new child window if its only navigation was opening a Native app. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698