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

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

Issue 2741413005: [ObjC ARC] Converts ios/chrome/browser/ui/bookmarks:bookmarks_arc to ARC. (Closed)
Patch Set: Created 3 years, 9 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_folder_table_view_cell.mm
diff --git a/ios/chrome/browser/ui/bookmarks/bookmark_folder_table_view_cell.mm b/ios/chrome/browser/ui/bookmarks/bookmark_folder_table_view_cell.mm
index 000130ab346ee54d08376972afc7aedd4ecc28af..a21b04211d50e5ff20d029516a327e253007338d 100644
--- a/ios/chrome/browser/ui/bookmarks/bookmark_folder_table_view_cell.mm
+++ b/ios/chrome/browser/ui/bookmarks/bookmark_folder_table_view_cell.mm
@@ -4,13 +4,16 @@
#import "ios/chrome/browser/ui/bookmarks/bookmark_folder_table_view_cell.h"
-#include "base/mac/scoped_nsobject.h"
#import "ios/chrome/browser/ui/bookmarks/bookmark_utils_ios.h"
#import "ios/chrome/browser/ui/rtl_geometry.h"
#include "ios/chrome/grit/ios_strings.h"
#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h"
#include "ui/base/l10n/l10n_util_mac.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
namespace {
// The amount in points by which to offset horizontally the text label.
const CGFloat kTitleLabelLeadingOffset = 18.0;
@@ -35,26 +38,24 @@ const CGFloat kFolderCellIndentationWidth = 32.0;
}
+ (instancetype)folderCell {
- base::scoped_nsobject<BookmarkFolderTableViewCell> folderCell(
+ BookmarkFolderTableViewCell* folderCell =
[[[self class] alloc] initWithStyle:UITableViewCellStyleDefault
- reuseIdentifier:[self folderCellReuseIdentifier]]);
- folderCell.get().indentationWidth = kFolderCellIndentationWidth;
- folderCell.get().imageView.image =
- [UIImage imageNamed:@"bookmark_gray_folder"];
- return folderCell.autorelease();
+ reuseIdentifier:[self folderCellReuseIdentifier]];
+ folderCell.indentationWidth = kFolderCellIndentationWidth;
+ folderCell.imageView.image = [UIImage imageNamed:@"bookmark_gray_folder"];
+ return folderCell;
}
+ (instancetype)folderCreationCell {
- base::scoped_nsobject<BookmarkFolderTableViewCell> newFolderCell(
- [[[self class] alloc]
- initWithStyle:UITableViewCellStyleDefault
- reuseIdentifier:[self folderCreationCellReuseIdentifier]]);
- newFolderCell.get().textLabel.text =
+ BookmarkFolderTableViewCell* newFolderCell = [[[self class] alloc]
+ initWithStyle:UITableViewCellStyleDefault
+ reuseIdentifier:[self folderCreationCellReuseIdentifier]];
+ newFolderCell.textLabel.text =
l10n_util::GetNSString(IDS_IOS_BOOKMARK_CREATE_GROUP);
- newFolderCell.get().imageView.image =
+ newFolderCell.imageView.image =
[UIImage imageNamed:@"bookmark_gray_new_folder"];
- newFolderCell.get().accessibilityIdentifier = @"Create New Folder";
- return newFolderCell.autorelease();
+ newFolderCell.accessibilityIdentifier = @"Create New Folder";
+ return newFolderCell;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style
@@ -74,10 +75,10 @@ const CGFloat kFolderCellIndentationWidth = 32.0;
- (void)setChecked:(BOOL)checked {
if (checked != _checked) {
_checked = checked;
- base::scoped_nsobject<UIImageView> checkImageView(
+ UIImageView* checkImageView =
checked ? [[UIImageView alloc]
initWithImage:[UIImage imageNamed:@"bookmark_blue_check"]]
- : nil);
+ : nil;
self.accessoryView = checkImageView;
}
}

Powered by Google App Engine
This is Rietveld 408576698