Index: ios/web/web_state/crw_web_view_proxy_impl.mm |
diff --git a/ios/web/web_state/crw_web_view_proxy_impl.mm b/ios/web/web_state/crw_web_view_proxy_impl.mm |
index 73c6b03459b8ddf7c1a3ae81e66cd40eb7c6ea91..9996420585aa46fa6f314cf02734cd33e42b5f16 100644 |
--- a/ios/web/web_state/crw_web_view_proxy_impl.mm |
+++ b/ios/web/web_state/crw_web_view_proxy_impl.mm |
@@ -5,12 +5,15 @@ |
#import "ios/web/web_state/crw_web_view_proxy_impl.h" |
#include "base/ios/ios_util.h" |
-#include "base/ios/weak_nsobject.h" |
#include "base/mac/scoped_nsobject.h" |
#import "ios/web/public/web_state/crw_web_view_scroll_view_proxy.h" |
#import "ios/web/public/web_state/ui/crw_content_view.h" |
#import "ios/web/web_state/ui/crw_web_controller.h" |
+#if !defined(__has_feature) || !__has_feature(objc_arc) |
+#error "This file requires ARC support." |
+#endif |
+ |
namespace { |
// Returns the first responder in the subviews of |view|, or nil if no view in |
@@ -66,20 +69,20 @@ UIView* GetFirstResponderSubview(UIView* view) { |
@end |
@implementation CRWWebViewProxyImpl { |
- base::WeakNSObject<CRWContentView> _contentView; |
- base::WeakNSObject<CRWWebController> _webController; |
+ __weak CRWWebController* _webController; |
base::scoped_nsobject<NSMutableDictionary> _registeredInsets; |
// The WebViewScrollViewProxy is a wrapper around the web view's |
// UIScrollView to give components access in a limited and controlled manner. |
base::scoped_nsobject<CRWWebViewScrollViewProxy> _contentViewScrollViewProxy; |
} |
+@synthesize contentView = _contentView; |
- (instancetype)initWithWebController:(CRWWebController*)webController { |
self = [super init]; |
if (self) { |
DCHECK(webController); |
_registeredInsets.reset([[NSMutableDictionary alloc] init]); |
- _webController.reset(webController); |
+ _webController = webController; |
_contentViewScrollViewProxy.reset([[CRWWebViewScrollViewProxy alloc] init]); |
} |
return self; |
@@ -146,12 +149,8 @@ UIView* GetFirstResponderSubview(UIView* view) { |
[_registeredInsets removeObjectForKey:callerValue]; |
} |
-- (CRWContentView*)contentView { |
- return _contentView.get(); |
-} |
- |
- (void)setContentView:(CRWContentView*)contentView { |
- _contentView.reset(contentView); |
+ _contentView = contentView; |
[_contentViewScrollViewProxy setScrollView:contentView.scrollView]; |
} |