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

Unified Diff: ios/chrome/browser/ui/overscroll_actions/overscroll_actions_view.mm

Issue 2933123002: [ObjC ARC] Converts ios/chrome/browser/ui/overscroll_actions:overscroll_actions to ARC. (Closed)
Patch Set: Created 3 years, 6 months 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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/overscroll_actions/overscroll_actions_view.mm
diff --git a/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_view.mm b/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_view.mm
index 9e2768c3ef089715c1e536311f95b1d4ca6d3e43..37a8f9caa30a2ef2eedc29c7dc93c1c423d3cc4e 100644
--- a/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_view.mm
+++ b/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_view.mm
@@ -7,12 +7,14 @@
#import <QuartzCore/QuartzCore.h>
#include "base/logging.h"
-#include "base/mac/objc_property_releaser.h"
-#include "base/mac/scoped_nsobject.h"
#include "ios/chrome/browser/ui/rtl_geometry.h"
#include "ios/chrome/browser/ui/uikit_ui_util.h"
#include "ios/chrome/grit/ios_theme_resources.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
namespace {
// Actions images.
NSString* const kNewTabActionImage = @"ptr_new_tab";
@@ -129,12 +131,11 @@ enum class OverscrollViewState {
CFTimeInterval _pullStartTimeInSeconds;
// Tap gesture recognizer that allow the user to tap on an action to activate
// it.
- base::scoped_nsobject<UITapGestureRecognizer> _tapGesture;
+ UITapGestureRecognizer* _tapGesture;
// Array of layers that will be centered vertically.
// The array is built the first time the method -layersToCenterVertically is
// called.
- base::scoped_nsobject<NSArray> _layersToCenterVertically;
- base::mac::ObjCPropertyReleaser _propertyReleaser_OverscrollActionsView;
+ NSArray* _layersToCenterVertically;
}
// Redefined to readwrite.
@@ -242,8 +243,6 @@ enum class OverscrollViewState {
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
- _propertyReleaser_OverscrollActionsView.Init(self,
- [OverscrollActionsView class]);
_deformationBehaviorEnabled = YES;
self.autoresizingMask =
UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
@@ -294,9 +293,9 @@ enum class OverscrollViewState {
if (UseRTLLayout())
[self setTransform:CGAffineTransformMakeScale(-1, 1)];
- _tapGesture.reset([[UITapGestureRecognizer alloc]
- initWithTarget:self
- action:@selector(tapGesture:)]);
+ _tapGesture =
+ [[UITapGestureRecognizer alloc] initWithTarget:self
+ action:@selector(tapGesture:)];
[_tapGesture setDelegate:self];
[self addGestureRecognizer:_tapGesture];
}
@@ -305,7 +304,7 @@ enum class OverscrollViewState {
- (void)dealloc {
[self.snapshotView removeFromSuperview];
- [super dealloc];
+ ;
}
- (BOOL)selectionCroppingEnabled {
@@ -695,16 +694,15 @@ enum class OverscrollViewState {
selectedActionDidChange:self.selectedAction];
}
-- (base::scoped_nsobject<NSArray>&)layersToCenterVertically {
+- (NSArray*)layersToCenterVertically {
if (!_layersToCenterVertically) {
- NSArray* layersToCenterVertically = @[
+ _layersToCenterVertically = @[
_selectionCircleLayer, _selectionCircleMaskLayer,
_addTabActionImageView.layer, _refreshActionImageView.layer,
_closeTabActionImageView.layer, _addTabActionImageViewHighlighted.layer,
_refreshActionImageViewHighlighted.layer,
_closeTabActionImageViewHighlighted.layer, _backgroundView.layer
];
- _layersToCenterVertically.reset([layersToCenterVertically retain]);
}
return _layersToCenterVertically;
}
@@ -712,7 +710,7 @@ enum class OverscrollViewState {
- (void)centerSubviewsVertically {
[CATransaction begin];
[CATransaction setDisableActions:YES];
- for (CALayer* layer in [self layersToCenterVertically].get()) {
+ for (CALayer* layer in self.layersToCenterVertically) {
CGPoint position = layer.position;
position.y = self.bounds.size.height / 2;
layer.position = position;

Powered by Google App Engine
This is Rietveld 408576698