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 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 if ([self.UIDelegate | |
695 respondsToSelector:@selector( | |
696 cancelJavaScriptDialogsForWebController:)]) { | |
Eugene But (OOO till 7-30)
2015/12/04 23:24:11
Factoring SEL to a separate local variable can mak
kkhorimoto
2015/12/10 01:27:32
Done.
| |
697 [self.UIDelegate cancelJavaScriptDialogsForWebController:self]; | |
698 } | |
699 | |
694 if (allowCache) | 700 if (allowCache) |
695 _expectedReconstructionURL = [self currentNavigationURL]; | 701 _expectedReconstructionURL = [self currentNavigationURL]; |
696 else | 702 else |
697 _expectedReconstructionURL = GURL(); | 703 _expectedReconstructionURL = GURL(); |
698 | 704 |
699 [self abortLoad]; | 705 [self abortLoad]; |
700 [self.webView removeFromSuperview]; | 706 [self.webView removeFromSuperview]; |
701 [self.containerView resetContent]; | 707 [self.containerView resetContent]; |
702 [self resetWebView]; | 708 [self resetWebView]; |
703 } | 709 } |
(...skipping 3162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3866 if ([MIMEType isEqualToString:@"text/html"] || | 3872 if ([MIMEType isEqualToString:@"text/html"] || |
3867 [MIMEType isEqualToString:@"application/xhtml+xml"] || | 3873 [MIMEType isEqualToString:@"application/xhtml+xml"] || |
3868 [MIMEType isEqualToString:@"application/xml"]) { | 3874 [MIMEType isEqualToString:@"application/xml"]) { |
3869 return web::WEB_VIEW_DOCUMENT_TYPE_HTML; | 3875 return web::WEB_VIEW_DOCUMENT_TYPE_HTML; |
3870 } | 3876 } |
3871 | 3877 |
3872 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; | 3878 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; |
3873 } | 3879 } |
3874 | 3880 |
3875 @end | 3881 @end |
OLD | NEW |