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

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

Issue 2746473003: [ObjC ARC] Converts ios/chrome/browser/ui/bookmarks:bookmarks to ARC. (Closed)
Patch Set: fix test 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_menu_item.mm
diff --git a/ios/chrome/browser/ui/bookmarks/bookmark_menu_item.mm b/ios/chrome/browser/ui/bookmarks/bookmark_menu_item.mm
index b5920fe97e1c35f43f9ac21aa8d8f48daf2cc20a..68b87122f4cd8e083d1aeac43fdd92deda134f6c 100644
--- a/ios/chrome/browser/ui/bookmarks/bookmark_menu_item.mm
+++ b/ios/chrome/browser/ui/bookmarks/bookmark_menu_item.mm
@@ -6,13 +6,16 @@
#include "base/hash.h"
#include "base/logging.h"
-#include "base/mac/objc_property_releaser.h"
#include "base/strings/sys_string_conversions.h"
#include "components/bookmarks/browser/bookmark_node.h"
#import "ios/chrome/browser/ui/bookmarks/bookmark_utils_ios.h"
#include "ios/chrome/grit/ios_strings.h"
#include "ui/base/l10n/l10n_util.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
using bookmarks::BookmarkNode;
namespace bookmarks {
@@ -32,9 +35,7 @@ BOOL NumberIsValidMenuItemType(int number) {
}
} // namespace bookmarks
-@interface BookmarkMenuItem () {
- base::mac::ObjCPropertyReleaser _propertyReleaser_BookmarkMenuItem;
-}
+@interface BookmarkMenuItem ()
// Redefined to be read-write.
@property(nonatomic, assign) const BookmarkNode* folder;
@property(nonatomic, assign) const BookmarkNode* rootAncestor;
@@ -50,14 +51,6 @@ BOOL NumberIsValidMenuItemType(int number) {
@synthesize sectionTitle = _sectionTitle;
@synthesize type = _type;
-- (instancetype)init {
- self = [super init];
- if (self) {
- _propertyReleaser_BookmarkMenuItem.Init(self, [BookmarkMenuItem class]);
- }
- return self;
-}
-
- (UIAccessibilityTraits)accessibilityTraits {
switch (self.type) {
case bookmarks::MenuItemFolder:
@@ -175,7 +168,7 @@ BOOL NumberIsValidMenuItemType(int number) {
- (BookmarkMenuItem*)parentItem {
if (self.type != bookmarks::MenuItemFolder)
return self;
- BookmarkMenuItem* item = [[[BookmarkMenuItem alloc] init] autorelease];
+ BookmarkMenuItem* item = [[BookmarkMenuItem alloc] init];
item.type = self.type;
item.folder = self.rootAncestor;
item.rootAncestor = self.rootAncestor;
@@ -194,14 +187,14 @@ BOOL NumberIsValidMenuItemType(int number) {
}
+ (BookmarkMenuItem*)dividerMenuItem {
- BookmarkMenuItem* item = [[[BookmarkMenuItem alloc] init] autorelease];
+ BookmarkMenuItem* item = [[BookmarkMenuItem alloc] init];
item.type = bookmarks::MenuItemDivider;
return item;
}
+ (BookmarkMenuItem*)folderMenuItemForNode:(const BookmarkNode*)node
rootAncestor:(const BookmarkNode*)ancestor {
- BookmarkMenuItem* item = [[[BookmarkMenuItem alloc] init] autorelease];
+ BookmarkMenuItem* item = [[BookmarkMenuItem alloc] init];
item.type = bookmarks::MenuItemFolder;
item.folder = node;
item.rootAncestor = ancestor;
@@ -209,7 +202,7 @@ BOOL NumberIsValidMenuItemType(int number) {
}
+ (BookmarkMenuItem*)sectionMenuItemWithTitle:(NSString*)title {
- BookmarkMenuItem* item = [[[BookmarkMenuItem alloc] init] autorelease];
+ BookmarkMenuItem* item = [[BookmarkMenuItem alloc] init];
item.type = bookmarks::MenuItemSectionHeader;
item.sectionTitle = title;
return item;
« no previous file with comments | « ios/chrome/browser/ui/bookmarks/bookmark_menu_cell.mm ('k') | ios/chrome/browser/ui/bookmarks/bookmark_menu_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698