Index: ios/chrome/browser/ui/contextual_search/contextual_search_results_view.mm |
diff --git a/ios/chrome/browser/ui/contextual_search/contextual_search_results_view.mm b/ios/chrome/browser/ui/contextual_search/contextual_search_results_view.mm |
index 49223218e399f395aea6c519b8855bd76e5f69d1..4337c93ea5cc575ce249cf9ebd949838e5e70c02 100644 |
--- a/ios/chrome/browser/ui/contextual_search/contextual_search_results_view.mm |
+++ b/ios/chrome/browser/ui/contextual_search/contextual_search_results_view.mm |
@@ -27,6 +27,10 @@ |
#import "ios/web/public/web_state/web_state.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 { |
enum SearchResultsViewVisibility { OFFSCREEN, PRELOAD, VISIBLE }; |
} |
@@ -39,8 +43,6 @@ enum SearchResultsViewVisibility { OFFSCREEN, PRELOAD, VISIBLE }; |
@end |
@implementation ContextualSearchResultsView { |
- base::WeakNSProtocol<id<ContextualSearchTabPromoter>> _promoter; |
- base::WeakNSProtocol<id<ContextualSearchPreloadChecker>> _preloadChecker; |
std::unique_ptr<ContextualSearchWebStateObserver> _webStateObserver; |
// WebState that loads the search results. |
@@ -48,7 +50,7 @@ enum SearchResultsViewVisibility { OFFSCREEN, PRELOAD, VISIBLE }; |
std::unique_ptr<WebStateOpener> _webStateOpener; |
// Access to the search tab's web view proxy. |
- base::scoped_nsprotocol<id<CRWWebViewProxy>> _webViewProxy; |
+ id<CRWWebViewProxy> _webViewProxy; |
BOOL _loaded; |
BOOL _displayed; |
@@ -67,6 +69,8 @@ enum SearchResultsViewVisibility { OFFSCREEN, PRELOAD, VISIBLE }; |
@synthesize active = _active; |
@synthesize opener = _opener; |
+@synthesize promoter = _promoter; |
+@synthesize preloadChecker = _preloadChecker; |
- (instancetype)initWithFrame:(CGRect)frame { |
if ((self = [super initWithFrame:frame])) { |
@@ -98,7 +102,7 @@ enum SearchResultsViewVisibility { OFFSCREEN, PRELOAD, VISIBLE }; |
} |
- (void)setPromoter:(id<ContextualSearchTabPromoter>)promoter { |
- _promoter.reset(promoter); |
+ _promoter = promoter; |
} |
- (id<ContextualSearchPreloadChecker>)preloadChecker { |
@@ -106,7 +110,7 @@ enum SearchResultsViewVisibility { OFFSCREEN, PRELOAD, VISIBLE }; |
} |
- (void)setPreloadChecker:(id<ContextualSearchPreloadChecker>)preloadChecker { |
- _preloadChecker.reset(preloadChecker); |
+ _preloadChecker = preloadChecker; |
} |
- (BOOL)contentVisible { |
@@ -121,13 +125,13 @@ enum SearchResultsViewVisibility { OFFSCREEN, PRELOAD, VISIBLE }; |
_webStateObserver->ObserveWebState(_webState.get()); |
_webState->SetShouldSuppressDialogs(false); |
- _webViewProxy.reset([[[tab webController] webViewProxy] retain]); |
+ _webViewProxy = [[tab webController] webViewProxy]; |
[[_webViewProxy scrollViewProxy] setBounces:NO]; |
} |
} else { |
// Stop watching the embedded Tab's web activity. |
_webStateObserver->ObserveWebState(nullptr); |
- _webViewProxy.reset(nil); |
+ _webViewProxy = nil; |
} |
_active = active; |
@@ -198,7 +202,7 @@ enum SearchResultsViewVisibility { OFFSCREEN, PRELOAD, VISIBLE }; |
[[tab webController] setNativeProvider:nil]; |
} |
self.active = NO; |
- _webViewProxy.reset(); |
+ _webViewProxy = nil; |
} |
- (void)cancelLoad { |