| 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 <WebKit/WebKit.h> | 7 #import <WebKit/WebKit.h> |
| 8 | 8 |
| 9 #import <objc/runtime.h> | 9 #import <objc/runtime.h> |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 3960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3971 // so that the delegate can return something immediately for the default | 3971 // so that the delegate can return something immediately for the default |
| 3972 // overlay image. | 3972 // overlay image. |
| 3973 _placeholderOverlayView.get().image = [[self class] defaultSnapshotImage]; | 3973 _placeholderOverlayView.get().image = [[self class] defaultSnapshotImage]; |
| 3974 } | 3974 } |
| 3975 } | 3975 } |
| 3976 | 3976 |
| 3977 - (void)removePlaceholderOverlay { | 3977 - (void)removePlaceholderOverlay { |
| 3978 if (!_placeholderOverlayView || _overlayPreviewMode) | 3978 if (!_placeholderOverlayView || _overlayPreviewMode) |
| 3979 return; | 3979 return; |
| 3980 | 3980 |
| 3981 [NSObject cancelPreviousPerformRequestsWithTarget:self | 3981 [NSObject |
| 3982 selector:@selector(removeOverlay) | 3982 cancelPreviousPerformRequestsWithTarget:self |
| 3983 object:nil]; | 3983 selector:@selector( |
| 3984 removePlaceholderOverlay) |
| 3985 object:nil]; |
| 3984 // Remove overlay with transition. | 3986 // Remove overlay with transition. |
| 3985 [UIView animateWithDuration:kSnapshotOverlayTransition | 3987 [UIView animateWithDuration:kSnapshotOverlayTransition |
| 3986 animations:^{ | 3988 animations:^{ |
| 3987 [_placeholderOverlayView setAlpha:0.0f]; | 3989 [_placeholderOverlayView setAlpha:0.0f]; |
| 3988 } | 3990 } |
| 3989 completion:^(BOOL finished) { | 3991 completion:^(BOOL finished) { |
| 3990 [_placeholderOverlayView removeFromSuperview]; | 3992 [_placeholderOverlayView removeFromSuperview]; |
| 3991 _placeholderOverlayView.reset(); | 3993 _placeholderOverlayView.reset(); |
| 3992 }]; | 3994 }]; |
| 3993 } | 3995 } |
| (...skipping 1790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5784 } | 5786 } |
| 5785 | 5787 |
| 5786 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; | 5788 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; |
| 5787 } | 5789 } |
| 5788 | 5790 |
| 5789 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { | 5791 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { |
| 5790 return [action.request valueForHTTPHeaderField:@"Referer"]; | 5792 return [action.request valueForHTTPHeaderField:@"Referer"]; |
| 5791 } | 5793 } |
| 5792 | 5794 |
| 5793 @end | 5795 @end |
| OLD | NEW |