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

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

Issue 1504493002: Added |-cancelJavaScriptDialogsForWebController:| to UI delegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: SEL stack variables Created 5 years 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
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 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 684
685 - (NSString*)scriptByAddingWindowIDCheckForScript:(NSString*)script { 685 - (NSString*)scriptByAddingWindowIDCheckForScript:(NSString*)script {
686 NSString* kTemplate = @"if (__gCrWeb['windowId'] === '%@') { %@; }"; 686 NSString* kTemplate = @"if (__gCrWeb['windowId'] === '%@') { %@; }";
687 return [NSString stringWithFormat:kTemplate, [self windowId], script]; 687 return [NSString stringWithFormat:kTemplate, [self windowId], script];
688 } 688 }
689 689
690 - (void)removeWebViewAllowingCachedReconstruction:(BOOL)allowCache { 690 - (void)removeWebViewAllowingCachedReconstruction:(BOOL)allowCache {
691 if (!self.webView) 691 if (!self.webView)
692 return; 692 return;
693 693
694 SEL cancelDialogsSelector =
695 @selector(cancelJavaScriptDialogsForWebController:);
696 if ([self.UIDelegate respondsToSelector:cancelDialogsSelector])
697 [self.UIDelegate cancelJavaScriptDialogsForWebController:self];
698
694 if (allowCache) 699 if (allowCache)
695 _expectedReconstructionURL = [self currentNavigationURL]; 700 _expectedReconstructionURL = [self currentNavigationURL];
696 else 701 else
697 _expectedReconstructionURL = GURL(); 702 _expectedReconstructionURL = GURL();
698 703
699 [self abortLoad]; 704 [self abortLoad];
700 [self.webView removeFromSuperview]; 705 [self.webView removeFromSuperview];
701 [self.containerView resetContent]; 706 [self.containerView resetContent];
702 [self resetWebView]; 707 [self resetWebView];
703 } 708 }
(...skipping 3162 matching lines...) Expand 10 before | Expand all | Expand 10 after
3866 if ([MIMEType isEqualToString:@"text/html"] || 3871 if ([MIMEType isEqualToString:@"text/html"] ||
3867 [MIMEType isEqualToString:@"application/xhtml+xml"] || 3872 [MIMEType isEqualToString:@"application/xhtml+xml"] ||
3868 [MIMEType isEqualToString:@"application/xml"]) { 3873 [MIMEType isEqualToString:@"application/xml"]) {
3869 return web::WEB_VIEW_DOCUMENT_TYPE_HTML; 3874 return web::WEB_VIEW_DOCUMENT_TYPE_HTML;
3870 } 3875 }
3871 3876
3872 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; 3877 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC;
3873 } 3878 }
3874 3879
3875 @end 3880 @end
OLDNEW
« no previous file with comments | « ios/web/public/web_state/crw_web_user_interface_delegate.h ('k') | ios/web/web_state/ui/crw_wk_web_view_web_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698