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

Unified Diff: ios/chrome/browser/ui/bookmarks/bookmark_collection_cells.mm

Issue 2610923005: Replace ObjCPropertyReleaser with ReleaseProperties() project-wide. (Closed)
Patch Set: weak -> assign Created 3 years, 11 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/bookmarks/bookmark_collection_cells.mm
diff --git a/ios/chrome/browser/ui/bookmarks/bookmark_collection_cells.mm b/ios/chrome/browser/ui/bookmarks/bookmark_collection_cells.mm
index 38ea80526f47f812abd7a0d07f0106af33e32ee6..17d677187f2d65ba2eeb23eefe3d083d12ab97a3 100644
--- a/ios/chrome/browser/ui/bookmarks/bookmark_collection_cells.mm
+++ b/ios/chrome/browser/ui/bookmarks/bookmark_collection_cells.mm
@@ -7,7 +7,7 @@
#import <QuartzCore/QuartzCore.h>
#include "base/logging.h"
-#include "base/mac/objc_property_releaser.h"
+#include "base/mac/objc_release_properties.h"
#include "base/mac/scoped_nsobject.h"
#import "ios/chrome/browser/ui/bookmarks/bookmark_extended_button.h"
#import "ios/chrome/browser/ui/bookmarks/bookmark_home_view_controller.h"
@@ -31,9 +31,6 @@ const CGFloat kBookmarkFolderCellDefaultImageSize = 24.0;
@protected
// Subclasses should set these in the constructor with the wanted values.
CGFloat _imageSize;
-
- @private
- base::mac::ObjCPropertyReleaser _propertyReleaser_BookmarkCell;
}
// Redefined to be read-write.
@property(nonatomic, retain) UILabel* titleLabel;
@@ -77,7 +74,6 @@ const CGFloat kBookmarkFolderCellDefaultImageSize = 24.0;
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
- _propertyReleaser_BookmarkCell.Init(self, [BookmarkCell class]);
self.exclusiveTouch = YES;
self.backgroundColor = [UIColor whiteColor];
@@ -122,6 +118,11 @@ const CGFloat kBookmarkFolderCellDefaultImageSize = 24.0;
return self;
}
+- (void)dealloc {
+ base::mac::ReleaseProperties(self);
+ [super dealloc];
+}
+
+ (BOOL)requiresConstraintBasedLayout {
return YES;
}
@@ -355,11 +356,6 @@ const CGFloat kBookmarkFolderCellDefaultImageSize = 24.0;
#pragma mark - BookmarkItemCell
-@interface BookmarkItemCell () {
- base::mac::ObjCPropertyReleaser _propertyReleaser_BookmarkItemCell;
-}
-@end
-
@implementation BookmarkItemCell
+ (NSString*)reuseIdentifier {
@@ -373,8 +369,6 @@ const CGFloat kBookmarkFolderCellDefaultImageSize = 24.0;
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
- _propertyReleaser_BookmarkItemCell.Init(self, [BookmarkItemCell class]);
-
// Set the non-layout properties of the titles.
UIFont* font = [MDCTypography subheadFont];
self.titleLabel.font = font;
@@ -386,6 +380,11 @@ const CGFloat kBookmarkFolderCellDefaultImageSize = 24.0;
return self;
}
+- (void)dealloc {
+ base::mac::ReleaseProperties(self);
+ [super dealloc];
+}
+
- (void)updateWithTitle:(NSString*)title {
[super updateWithTitle:title];
[self updateAccessibilityValues];
@@ -407,12 +406,6 @@ const CGFloat kBookmarkFolderCellDefaultImageSize = 24.0;
#pragma mark - BookmarkFolderCell
-@interface BookmarkFolderCell () {
- base::mac::ObjCPropertyReleaser _propertyReleaser_BookmarkFolderCell;
-}
-
-@end
-
@implementation BookmarkFolderCell
+ (NSString*)reuseIdentifier {
@@ -422,8 +415,6 @@ const CGFloat kBookmarkFolderCellDefaultImageSize = 24.0;
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
- _propertyReleaser_BookmarkFolderCell.Init(self, [BookmarkFolderCell class]);
-
self.imageView.image = [UIImage imageNamed:@"bookmark_gray_folder"];
self.titleLabel.font = [MDCTypography subheadFont];
@@ -432,6 +423,11 @@ const CGFloat kBookmarkFolderCellDefaultImageSize = 24.0;
return self;
}
+- (void)dealloc {
+ base::mac::ReleaseProperties(self);
+ [super dealloc];
+}
+
- (void)prepareForReuse {
[super prepareForReuse];
[self setImage:[UIImage imageNamed:@"bookmark_gray_folder"]];
@@ -448,9 +444,7 @@ const CGFloat kBookmarkFolderCellDefaultImageSize = 24.0;
#pragma mark - BookmarkHeaderView
-@interface BookmarkHeaderView () {
- base::mac::ObjCPropertyReleaser _propertyReleaser_BookmarkHeaderView;
-}
+@interface BookmarkHeaderView ()
@property(nonatomic, retain) UILabel* titleLabel;
@end
@@ -467,7 +461,6 @@ const CGFloat kBookmarkFolderCellDefaultImageSize = 24.0;
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
- _propertyReleaser_BookmarkHeaderView.Init(self, [BookmarkHeaderView class]);
base::scoped_nsobject<UILabel> titleLabel(
[[UILabel alloc] initWithFrame:CGRectZero]);
self.titleLabel = titleLabel;
@@ -481,6 +474,11 @@ const CGFloat kBookmarkFolderCellDefaultImageSize = 24.0;
return self;
}
+- (void)dealloc {
+ base::mac::ReleaseProperties(self);
+ [super dealloc];
+}
+
- (void)layoutSubviews {
[super layoutSubviews];
@@ -507,9 +505,7 @@ const CGFloat kBookmarkFolderCellDefaultImageSize = 24.0;
#pragma mark - BookmarkHeaderSeparatorView
-@interface BookmarkHeaderSeparatorView () {
- base::mac::ObjCPropertyReleaser _propertyReleaser_BookmarkHeaderSeparatorView;
-}
+@interface BookmarkHeaderSeparatorView ()
// The bottom separator line.
@property(nonatomic, retain) UIView* lineView;
@end
@@ -529,8 +525,6 @@ const CGFloat kBookmarkFolderCellDefaultImageSize = 24.0;
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
- _propertyReleaser_BookmarkHeaderSeparatorView.Init(
- self, [BookmarkHeaderSeparatorView class]);
_lineView = [[UIView alloc] init];
_lineView.backgroundColor = bookmark_utils_ios::separatorColor();
[self addSubview:_lineView];
@@ -538,6 +532,11 @@ const CGFloat kBookmarkFolderCellDefaultImageSize = 24.0;
return self;
}
+- (void)dealloc {
+ base::mac::ReleaseProperties(self);
+ [super dealloc];
+}
+
- (void)layoutSubviews {
CGFloat lineHeight = 1;
CGFloat lineY = self.bounds.size.height - lineHeight - 8;

Powered by Google App Engine
This is Rietveld 408576698