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

Unified Diff: ios/chrome/browser/ui/settings/material_cell_catalog_view_controller.mm

Issue 2814813003: [ObjC ARC] Converts ios/chrome/browser/ui/settings:settings_arc_transition to ARC. (Closed)
Patch Set: rebase Created 3 years, 8 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/settings/material_cell_catalog_view_controller.mm
diff --git a/ios/chrome/browser/ui/settings/material_cell_catalog_view_controller.mm b/ios/chrome/browser/ui/settings/material_cell_catalog_view_controller.mm
index 93334ac71449d00ff2baa6b38efb05b930023c65..df84898983330d55616d0885c6db7c5101782f37 100644
--- a/ios/chrome/browser/ui/settings/material_cell_catalog_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/material_cell_catalog_view_controller.mm
@@ -7,7 +7,6 @@
#import <UIKit/UIKit.h>
#import "base/mac/foundation_util.h"
-#import "base/mac/scoped_nsobject.h"
#include "components/autofill/core/browser/autofill_data_util.h"
#include "components/autofill/core/browser/credit_card.h"
#include "components/grit/components_scaled_resources.h"
@@ -44,6 +43,10 @@
#import "ios/third_party/material_components_ios/src/components/Palettes/src/MaterialPalettes.h"
#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
namespace {
typedef NS_ENUM(NSInteger, SectionIdentifier) {
@@ -113,34 +116,34 @@ const CGFloat kHorizontalImageFixedSize = 40;
// Text cells.
[model addSectionWithIdentifier:SectionIdentifierTextCell];
- CollectionViewTextItem* textHeader = [
- [[CollectionViewTextItem alloc] initWithType:ItemTypeHeader] autorelease];
+ CollectionViewTextItem* textHeader =
+ [[CollectionViewTextItem alloc] initWithType:ItemTypeHeader];
textHeader.text = @"CollectionViewTextCell";
textHeader.textFont = [MDCTypography body2Font];
textHeader.textColor = [[MDCPalette greyPalette] tint500];
[model setHeader:textHeader
forSectionWithIdentifier:SectionIdentifierTextCell];
- CollectionViewTextItem* textCell = [[[CollectionViewTextItem alloc]
- initWithType:ItemTypeTextCheckmark] autorelease];
+ CollectionViewTextItem* textCell =
+ [[CollectionViewTextItem alloc] initWithType:ItemTypeTextCheckmark];
textCell.text = @"Text cell 1";
textCell.accessoryType = MDCCollectionViewCellAccessoryCheckmark;
[model addItem:textCell toSectionWithIdentifier:SectionIdentifierTextCell];
- CollectionViewTextItem* textCell2 = [[[CollectionViewTextItem alloc]
- initWithType:ItemTypeTextDetail] autorelease];
+ CollectionViewTextItem* textCell2 =
+ [[CollectionViewTextItem alloc] initWithType:ItemTypeTextDetail];
textCell2.text =
@"Text cell with text that is so long it must truncate at some point";
textCell2.accessoryType = MDCCollectionViewCellAccessoryDetailButton;
[model addItem:textCell2 toSectionWithIdentifier:SectionIdentifierTextCell];
CollectionViewTextItem* textCell3 =
- [[[CollectionViewTextItem alloc] initWithType:ItemTypeText] autorelease];
+ [[CollectionViewTextItem alloc] initWithType:ItemTypeText];
textCell3.text = @"Truncated text cell with three lines:";
textCell3.detailText = @"One title line and two detail lines, so it should "
@"wrap nicely at some point.";
textCell3.numberOfDetailTextLines = 0;
[model addItem:textCell3 toSectionWithIdentifier:SectionIdentifierTextCell];
CollectionViewTextItem* smallTextCell =
- [[[CollectionViewTextItem alloc] initWithType:ItemTypeText] autorelease];
+ [[CollectionViewTextItem alloc] initWithType:ItemTypeText];
smallTextCell.text = @"Text cell with small font but height of 48.";
smallTextCell.textFont = [smallTextCell.textFont fontWithSize:8];
[model addItem:smallTextCell
@@ -148,7 +151,7 @@ const CGFloat kHorizontalImageFixedSize = 40;
// Text and Error cell.
TextAndErrorItem* textAndErrorItem =
- [[[TextAndErrorItem alloc] initWithType:ItemTypeTextError] autorelease];
+ [[TextAndErrorItem alloc] initWithType:ItemTypeTextError];
textAndErrorItem.text = @"Text and Error cell";
textAndErrorItem.shouldDisplayError = YES;
textAndErrorItem.accessoryType =
@@ -158,43 +161,41 @@ const CGFloat kHorizontalImageFixedSize = 40;
// Detail cells.
[model addSectionWithIdentifier:SectionIdentifierDetailCell];
- CollectionViewDetailItem* detailBasic = [[[CollectionViewDetailItem alloc]
- initWithType:ItemTypeDetailBasic] autorelease];
+ CollectionViewDetailItem* detailBasic =
+ [[CollectionViewDetailItem alloc] initWithType:ItemTypeDetailBasic];
detailBasic.text = @"Preload Webpages";
detailBasic.detailText = @"Only on Wi-Fi";
detailBasic.accessoryType = MDCCollectionViewCellAccessoryDisclosureIndicator;
[model addItem:detailBasic
toSectionWithIdentifier:SectionIdentifierDetailCell];
CollectionViewDetailItem* detailMediumLeft =
- [[[CollectionViewDetailItem alloc] initWithType:ItemTypeDetailLeftMedium]
- autorelease];
+ [[CollectionViewDetailItem alloc] initWithType:ItemTypeDetailLeftMedium];
detailMediumLeft.text = @"A long string but it should fit";
detailMediumLeft.detailText = @"Detail";
[model addItem:detailMediumLeft
toSectionWithIdentifier:SectionIdentifierDetailCell];
CollectionViewDetailItem* detailMediumRight =
- [[[CollectionViewDetailItem alloc] initWithType:ItemTypeDetailRightMedium]
- autorelease];
+ [[CollectionViewDetailItem alloc] initWithType:ItemTypeDetailRightMedium];
detailMediumRight.text = @"Main";
detailMediumRight.detailText = @"A long string but it should fit";
[model addItem:detailMediumRight
toSectionWithIdentifier:SectionIdentifierDetailCell];
- CollectionViewDetailItem* detailLongLeft = [[[CollectionViewDetailItem alloc]
- initWithType:ItemTypeDetailLeftLong] autorelease];
+ CollectionViewDetailItem* detailLongLeft =
+ [[CollectionViewDetailItem alloc] initWithType:ItemTypeDetailLeftLong];
detailLongLeft.text =
@"This is a very long main text that is intended to overflow";
detailLongLeft.detailText = @"Detail Text";
[model addItem:detailLongLeft
toSectionWithIdentifier:SectionIdentifierDetailCell];
- CollectionViewDetailItem* detailLongRight = [[[CollectionViewDetailItem alloc]
- initWithType:ItemTypeDetailRightLong] autorelease];
+ CollectionViewDetailItem* detailLongRight =
+ [[CollectionViewDetailItem alloc] initWithType:ItemTypeDetailRightLong];
detailLongRight.text = @"Main Text";
detailLongRight.detailText =
@"This is a very long detail text that is intended to overflow";
[model addItem:detailLongRight
toSectionWithIdentifier:SectionIdentifierDetailCell];
- CollectionViewDetailItem* detailLongBoth = [[[CollectionViewDetailItem alloc]
- initWithType:ItemTypeDetailBothLong] autorelease];
+ CollectionViewDetailItem* detailLongBoth =
+ [[CollectionViewDetailItem alloc] initWithType:ItemTypeDetailBothLong];
detailLongBoth.text =
@"This is a very long main text that is intended to overflow";
detailLongBoth.detailText =
@@ -213,18 +214,15 @@ const CGFloat kHorizontalImageFixedSize = 40;
// Native app cells.
[model addSectionWithIdentifier:SectionIdentifierNativeAppCell];
- NativeAppItem* fooApp =
- [[[NativeAppItem alloc] initWithType:ItemTypeApp] autorelease];
+ NativeAppItem* fooApp = [[NativeAppItem alloc] initWithType:ItemTypeApp];
fooApp.name = @"App Foo";
fooApp.state = NativeAppItemSwitchOff;
[model addItem:fooApp toSectionWithIdentifier:SectionIdentifierNativeAppCell];
- NativeAppItem* barApp =
- [[[NativeAppItem alloc] initWithType:ItemTypeApp] autorelease];
+ NativeAppItem* barApp = [[NativeAppItem alloc] initWithType:ItemTypeApp];
barApp.name = @"App Bar";
barApp.state = NativeAppItemSwitchOn;
[model addItem:barApp toSectionWithIdentifier:SectionIdentifierNativeAppCell];
- NativeAppItem* bazApp =
- [[[NativeAppItem alloc] initWithType:ItemTypeApp] autorelease];
+ NativeAppItem* bazApp = [[NativeAppItem alloc] initWithType:ItemTypeApp];
bazApp.name = @"App Baz Qux Bla Bug Lorem ipsum dolor sit amet";
bazApp.state = NativeAppItemInstall;
[model addItem:bazApp toSectionWithIdentifier:SectionIdentifierNativeAppCell];
@@ -261,32 +259,32 @@ const CGFloat kHorizontalImageFixedSize = 40;
[model addItem:[self paymentsItemWithWrappingTextandOptionalImage]
toSectionWithIdentifier:SectionIdentifierPayments];
PriceItem* priceItem1 =
- [[[PriceItem alloc] initWithType:ItemTypePaymentsSingleLine] autorelease];
+ [[PriceItem alloc] initWithType:ItemTypePaymentsSingleLine];
priceItem1.item = @"Total";
priceItem1.notification = @"Updated";
priceItem1.price = @"USD $100.00";
[model addItem:priceItem1 toSectionWithIdentifier:SectionIdentifierPayments];
PriceItem* priceItem2 =
- [[[PriceItem alloc] initWithType:ItemTypePaymentsSingleLine] autorelease];
+ [[PriceItem alloc] initWithType:ItemTypePaymentsSingleLine];
priceItem2.item = @"Price label is long and should get clipped";
priceItem2.notification = @"Updated";
priceItem2.price = @"USD $1,000,000.00";
[model addItem:priceItem2 toSectionWithIdentifier:SectionIdentifierPayments];
PriceItem* priceItem3 =
- [[[PriceItem alloc] initWithType:ItemTypePaymentsSingleLine] autorelease];
+ [[PriceItem alloc] initWithType:ItemTypePaymentsSingleLine];
priceItem3.item = @"Price label is long and should get clipped";
priceItem3.notification = @"Should get clipped too";
priceItem3.price = @"USD $1,000,000.00";
[model addItem:priceItem3 toSectionWithIdentifier:SectionIdentifierPayments];
PriceItem* priceItem4 =
- [[[PriceItem alloc] initWithType:ItemTypePaymentsSingleLine] autorelease];
+ [[PriceItem alloc] initWithType:ItemTypePaymentsSingleLine];
priceItem4.item = @"Price label is long and should get clipped";
priceItem4.notification = @"Should get clipped too";
priceItem4.price = @"USD $1,000,000,000.00";
[model addItem:priceItem4 toSectionWithIdentifier:SectionIdentifierPayments];
- AutofillProfileItem* profileItem1 = [[[AutofillProfileItem alloc]
- initWithType:ItemTypePaymentsDynamicHeight] autorelease];
+ AutofillProfileItem* profileItem1 =
+ [[AutofillProfileItem alloc] initWithType:ItemTypePaymentsDynamicHeight];
profileItem1.name = @"Profile Name gets wrapped if it's too long";
profileItem1.address = @"Profile Address also gets wrapped if it's too long";
profileItem1.phoneNumber = @"123-456-7890";
@@ -294,15 +292,15 @@ const CGFloat kHorizontalImageFixedSize = 40;
profileItem1.notification = @"Some fields are missing";
[model addItem:profileItem1
toSectionWithIdentifier:SectionIdentifierPayments];
- AutofillProfileItem* profileItem2 = [[[AutofillProfileItem alloc]
- initWithType:ItemTypePaymentsDynamicHeight] autorelease];
+ AutofillProfileItem* profileItem2 =
+ [[AutofillProfileItem alloc] initWithType:ItemTypePaymentsDynamicHeight];
profileItem1.name = @"All fields are optional";
profileItem2.phoneNumber = @"123-456-7890";
profileItem2.notification = @"Some fields are missing";
[model addItem:profileItem2
toSectionWithIdentifier:SectionIdentifierPayments];
- AutofillProfileItem* profileItem3 = [[[AutofillProfileItem alloc]
- initWithType:ItemTypePaymentsDynamicHeight] autorelease];
+ AutofillProfileItem* profileItem3 =
+ [[AutofillProfileItem alloc] initWithType:ItemTypePaymentsDynamicHeight];
profileItem3.address = @"All fields are optional";
profileItem3.email = @"foo@bar.com";
[model addItem:profileItem3
@@ -444,8 +442,7 @@ const CGFloat kHorizontalImageFixedSize = 40;
- (CollectionViewItem*)accountItemDetailWithError {
CollectionViewAccountItem* accountItemDetail =
- [[[CollectionViewAccountItem alloc] initWithType:ItemTypeAccountDetail]
- autorelease];
+ [[CollectionViewAccountItem alloc] initWithType:ItemTypeAccountDetail];
accountItemDetail.image = [UIImage imageNamed:@"default_avatar"];
accountItemDetail.text = @"Account User Name";
accountItemDetail.detailText =
@@ -458,8 +455,7 @@ const CGFloat kHorizontalImageFixedSize = 40;
- (CollectionViewItem*)accountItemCheckMark {
CollectionViewAccountItem* accountItemCheckMark =
- [[[CollectionViewAccountItem alloc] initWithType:ItemTypeAccountCheckMark]
- autorelease];
+ [[CollectionViewAccountItem alloc] initWithType:ItemTypeAccountCheckMark];
accountItemCheckMark.image = [UIImage imageNamed:@"default_avatar"];
accountItemCheckMark.text = @"Lorem ipsum dolor sit amet, consectetur "
@"adipiscing elit, sed do eiusmod tempor "
@@ -472,8 +468,8 @@ const CGFloat kHorizontalImageFixedSize = 40;
}
- (CollectionViewItem*)accountSignInItem {
- AccountSignInItem* accountSignInItem = [[[AccountSignInItem alloc]
- initWithType:ItemTypeAccountSignIn] autorelease];
+ AccountSignInItem* accountSignInItem =
+ [[AccountSignInItem alloc] initWithType:ItemTypeAccountSignIn];
accountSignInItem.image =
CircularImageFromImage(ios::GetChromeBrowserProvider()
->GetSigninResourcesProvider()
@@ -483,28 +479,28 @@ const CGFloat kHorizontalImageFixedSize = 40;
}
- (CollectionViewItem*)coldStateSigninPromoItem {
- SigninPromoItem* signinPromoItem = [[[SigninPromoItem alloc]
- initWithType:ItemTypeWarmStateSigninPromo] autorelease];
+ SigninPromoItem* signinPromoItem =
+ [[SigninPromoItem alloc] initWithType:ItemTypeWarmStateSigninPromo];
signinPromoItem.configurator =
- [[[SigninPromoViewConfigurator alloc] initWithUserEmail:nil
- userFullName:nil
- userImage:nil] autorelease];
+ [[SigninPromoViewConfigurator alloc] initWithUserEmail:nil
+ userFullName:nil
+ userImage:nil];
return signinPromoItem;
}
- (CollectionViewItem*)warmStateSigninPromoItem {
- SigninPromoItem* signinPromoItem = [[[SigninPromoItem alloc]
- initWithType:ItemTypeColdStateSigninPromo] autorelease];
- signinPromoItem.configurator = [[[SigninPromoViewConfigurator alloc]
+ SigninPromoItem* signinPromoItem =
+ [[SigninPromoItem alloc] initWithType:ItemTypeColdStateSigninPromo];
+ signinPromoItem.configurator = [[SigninPromoViewConfigurator alloc]
initWithUserEmail:@"jonhdoe@example.com"
userFullName:@"John Doe"
- userImage:nil] autorelease];
+ userImage:nil];
return signinPromoItem;
}
- (CollectionViewItem*)accountControlItem {
- AccountControlItem* item = [[[AccountControlItem alloc]
- initWithType:ItemTypeAccountControlDynamicHeight] autorelease];
+ AccountControlItem* item = [[AccountControlItem alloc]
+ initWithType:ItemTypeAccountControlDynamicHeight];
item.image = [UIImage imageNamed:@"settings_sync"];
item.text = @"Account Sync Settings";
item.detailText = @"Detail text";
@@ -513,8 +509,8 @@ const CGFloat kHorizontalImageFixedSize = 40;
}
- (CollectionViewItem*)accountControlItemWithExtraLongText {
- AccountControlItem* item = [[[AccountControlItem alloc]
- initWithType:ItemTypeAccountControlDynamicHeight] autorelease];
+ AccountControlItem* item = [[AccountControlItem alloc]
+ initWithType:ItemTypeAccountControlDynamicHeight];
item.image = [ChromeIcon infoIcon];
item.text = @"Account Control Settings";
item.detailText =
@@ -526,16 +522,16 @@ const CGFloat kHorizontalImageFixedSize = 40;
#pragma mark Private
- (CollectionViewItem*)basicSwitchItem {
- CollectionViewSwitchItem* item = [[[CollectionViewSwitchItem alloc]
- initWithType:ItemTypeSwitchBasic] autorelease];
+ CollectionViewSwitchItem* item =
+ [[CollectionViewSwitchItem alloc] initWithType:ItemTypeSwitchBasic];
item.text = @"Enable awesomeness.";
item.on = YES;
return item;
}
- (CollectionViewItem*)longTextSwitchItem {
- CollectionViewSwitchItem* item = [[[CollectionViewSwitchItem alloc]
- initWithType:ItemTypeSwitchDynamicHeight] autorelease];
+ CollectionViewSwitchItem* item = [[CollectionViewSwitchItem alloc]
+ initWithType:ItemTypeSwitchDynamicHeight];
item.text = @"Enable awesomeness. This is a very long text that is intended "
@"to overflow.";
item.on = YES;
@@ -544,7 +540,7 @@ const CGFloat kHorizontalImageFixedSize = 40;
- (CollectionViewItem*)syncSwitchItem {
SyncSwitchItem* item =
- [[[SyncSwitchItem alloc] initWithType:ItemTypeSwitchSync] autorelease];
+ [[SyncSwitchItem alloc] initWithType:ItemTypeSwitchSync];
item.text = @"Cell used in Sync Settings";
item.detailText =
@"This is a very long text that is intended to overflow to two lines.";
@@ -553,8 +549,8 @@ const CGFloat kHorizontalImageFixedSize = 40;
}
- (CollectionViewItem*)paymentsItemWithWrappingTextandOptionalImage {
- PaymentsTextItem* item = [[[PaymentsTextItem alloc]
- initWithType:ItemTypePaymentsDynamicHeight] autorelease];
+ PaymentsTextItem* item =
+ [[PaymentsTextItem alloc] initWithType:ItemTypePaymentsDynamicHeight];
item.text = @"If you want to display a long text that wraps to the next line "
@"and may need to feature an image this is the cell to use.";
item.image = [UIImage imageNamed:@"app_icon_placeholder"];
@@ -562,8 +558,8 @@ const CGFloat kHorizontalImageFixedSize = 40;
}
- (CollectionViewItem*)autofillItemWithMainAndTrailingText {
- AutofillDataItem* item = [[[AutofillDataItem alloc]
- initWithType:ItemTypeAutofillDynamicHeight] autorelease];
+ AutofillDataItem* item =
+ [[AutofillDataItem alloc] initWithType:ItemTypeAutofillDynamicHeight];
item.text = @"Main Text";
item.trailingDetailText = @"Trailing Detail Text";
item.accessoryType = MDCCollectionViewCellAccessoryNone;
@@ -571,8 +567,8 @@ const CGFloat kHorizontalImageFixedSize = 40;
}
- (CollectionViewItem*)autofillItemWithLeadingTextOnly {
- AutofillDataItem* item = [[[AutofillDataItem alloc]
- initWithType:ItemTypeAutofillDynamicHeight] autorelease];
+ AutofillDataItem* item =
+ [[AutofillDataItem alloc] initWithType:ItemTypeAutofillDynamicHeight];
item.text = @"Main Text";
item.leadingDetailText = @"Leading Detail Text";
item.accessoryType = MDCCollectionViewCellAccessoryDisclosureIndicator;
@@ -580,8 +576,8 @@ const CGFloat kHorizontalImageFixedSize = 40;
}
- (CollectionViewItem*)autofillItemWithAllText {
- AutofillDataItem* item = [[[AutofillDataItem alloc]
- initWithType:ItemTypeAutofillDynamicHeight] autorelease];
+ AutofillDataItem* item =
+ [[AutofillDataItem alloc] initWithType:ItemTypeAutofillDynamicHeight];
item.text = @"Main Text";
item.leadingDetailText = @"Leading Detail Text";
item.trailingDetailText = @"Trailing Detail Text";
@@ -590,8 +586,8 @@ const CGFloat kHorizontalImageFixedSize = 40;
}
- (CollectionViewItem*)autofillEditItem {
- AutofillEditItem* item = [[[AutofillEditItem alloc]
- initWithType:ItemTypeAutofillDynamicHeight] autorelease];
+ AutofillEditItem* item =
+ [[AutofillEditItem alloc] initWithType:ItemTypeAutofillDynamicHeight];
item.textFieldName = @"Required Card Number";
item.textFieldValue = @"4111111111111111";
item.textFieldEnabled = YES;
@@ -600,8 +596,8 @@ const CGFloat kHorizontalImageFixedSize = 40;
}
- (CollectionViewItem*)autofillEditItemWithIcon {
- AutofillEditItem* item = [[[AutofillEditItem alloc]
- initWithType:ItemTypeAutofillDynamicHeight] autorelease];
+ AutofillEditItem* item =
+ [[AutofillEditItem alloc] initWithType:ItemTypeAutofillDynamicHeight];
item.textFieldName = @"Card Number";
item.textFieldValue = @"4111111111111111";
item.textFieldEnabled = YES;
@@ -615,8 +611,7 @@ const CGFloat kHorizontalImageFixedSize = 40;
}
- (CollectionViewItem*)cvcItem {
- CVCItem* item =
- [[[CVCItem alloc] initWithType:ItemTypeAutofillCVC] autorelease];
+ CVCItem* item = [[CVCItem alloc] initWithType:ItemTypeAutofillCVC];
item.instructionsText =
@"This is a long text explaining to enter card details and what "
@"will happen afterwards.";
@@ -625,8 +620,7 @@ const CGFloat kHorizontalImageFixedSize = 40;
}
- (CollectionViewItem*)cvcItemWithDate {
- CVCItem* item =
- [[[CVCItem alloc] initWithType:ItemTypeAutofillCVC] autorelease];
+ CVCItem* item = [[CVCItem alloc] initWithType:ItemTypeAutofillCVC];
item.instructionsText =
@"This is a long text explaining to enter card details and what "
@"will happen afterwards.";
@@ -636,8 +630,7 @@ const CGFloat kHorizontalImageFixedSize = 40;
}
- (CollectionViewItem*)cvcItemWithError {
- CVCItem* item =
- [[[CVCItem alloc] initWithType:ItemTypeAutofillCVC] autorelease];
+ CVCItem* item = [[CVCItem alloc] initWithType:ItemTypeAutofillCVC];
item.instructionsText =
@"This is a long text explaining to enter card details and what "
@"will happen afterwards. Is this long enough to span 3 lines?";
@@ -649,23 +642,20 @@ const CGFloat kHorizontalImageFixedSize = 40;
}
- (CollectionViewItem*)statusItemVerifying {
- StatusItem* item =
- [[[StatusItem alloc] initWithType:ItemTypeAutofillStatus] autorelease];
+ StatusItem* item = [[StatusItem alloc] initWithType:ItemTypeAutofillStatus];
item.text = @"Verifying…";
return item;
}
- (CollectionViewItem*)statusItemVerified {
- StatusItem* item =
- [[[StatusItem alloc] initWithType:ItemTypeAutofillStatus] autorelease];
+ StatusItem* item = [[StatusItem alloc] initWithType:ItemTypeAutofillStatus];
item.state = StatusItemState::VERIFIED;
item.text = @"Verified!";
return item;
}
- (CollectionViewItem*)statusItemError {
- StatusItem* item =
- [[[StatusItem alloc] initWithType:ItemTypeAutofillStatus] autorelease];
+ StatusItem* item = [[StatusItem alloc] initWithType:ItemTypeAutofillStatus];
item.state = StatusItemState::ERROR;
item.text = @"There was a really long error. We can't tell you more, but we "
@"will still display this long string.";
@@ -673,22 +663,22 @@ const CGFloat kHorizontalImageFixedSize = 40;
}
- (CollectionViewItem*)storageSwitchItem {
- StorageSwitchItem* item = [[[StorageSwitchItem alloc]
- initWithType:ItemTypeAutofillStorageSwitch] autorelease];
+ StorageSwitchItem* item =
+ [[StorageSwitchItem alloc] initWithType:ItemTypeAutofillStorageSwitch];
item.on = YES;
return item;
}
- (CollectionViewFooterItem*)shortFooterItem {
- CollectionViewFooterItem* footerItem = [[[CollectionViewFooterItem alloc]
- initWithType:ItemTypeFooter] autorelease];
+ CollectionViewFooterItem* footerItem =
+ [[CollectionViewFooterItem alloc] initWithType:ItemTypeFooter];
footerItem.text = @"Hello";
return footerItem;
}
- (CollectionViewFooterItem*)longFooterItem {
- CollectionViewFooterItem* footerItem = [[[CollectionViewFooterItem alloc]
- initWithType:ItemTypeFooter] autorelease];
+ CollectionViewFooterItem* footerItem =
+ [[CollectionViewFooterItem alloc] initWithType:ItemTypeFooter];
footerItem.text = @"Hello Hello Hello Hello Hello Hello Hello Hello Hello "
@"Hello Hello Hello Hello Hello Hello Hello Hello Hello "
@"Hello Hello Hello Hello Hello Hello Hello Hello Hello ";

Powered by Google App Engine
This is Rietveld 408576698