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

Unified Diff: ios/chrome/today_extension/physical_web_optin_footer.mm

Issue 2938433002: [ObjC ARC] Converts ios/chrome/today_extension:today_extension 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/today_extension/physical_web_optin_footer.mm
diff --git a/ios/chrome/today_extension/physical_web_optin_footer.mm b/ios/chrome/today_extension/physical_web_optin_footer.mm
index 9287489c6ae7d5a4de2c9a07ad93a00c8556912d..fc98bd9d1d5caa284d3ea703567b648e0d76cf2d 100644
--- a/ios/chrome/today_extension/physical_web_optin_footer.mm
+++ b/ios/chrome/today_extension/physical_web_optin_footer.mm
@@ -59,9 +59,9 @@ const CGFloat kDescriptionFontSize = 14;
// Distance between the icon and the title.
CGFloat _imageTextSeparator;
// Opt-in action block.
- base::mac::ScopedBlock<EnableDisableBlock> _optinAction;
+ EnableDisableBlock _optinAction;
// Dismiss action block.
- base::mac::ScopedBlock<EnableDisableBlock> _dismissAction;
+ EnableDisableBlock _dismissAction;
// Whether the screen is locked.
BOOL _locked;
}
@@ -116,9 +116,8 @@ const CGFloat kDescriptionFontSize = 14;
linkBlock:learnMoreBlock
buttonBlock:NULL]);
[_descriptionLabel setTranslatesAutoresizingMaskIntoConstraints:NO];
- UIStackView* textStack = [[[UIStackView alloc]
- initWithArrangedSubviews:@[ _titleView, _descriptionLabel ]]
- autorelease];
+ UIStackView* textStack = [[UIStackView alloc]
+ initWithArrangedSubviews:@[ _titleView, _descriptionLabel ]];
[textStack setAxis:UILayoutConstraintAxisVertical];
[textStack setDistribution:UIStackViewDistributionEqualSpacing];
@@ -184,7 +183,7 @@ const CGFloat kDescriptionFontSize = 14;
[_dismissButton addTarget:self
action:@selector(dismissButtonPressed:)
forControlEvents:UIControlEventTouchUpInside];
- _dismissAction.reset(dismissAction, base::scoped_policy::RETAIN);
+ _dismissAction = [dismissAction copy];
[_dismissButton setTranslatesAutoresizingMaskIntoConstraints:NO];
_optInButton.reset([[TransparentButton alloc] initWithFrame:CGRectZero]);
@@ -207,7 +206,7 @@ const CGFloat kDescriptionFontSize = 14;
[[_optInButton widthAnchor]
constraintEqualToAnchor:[_dismissButton widthAnchor]];
- _optinAction.reset(optinAction, base::scoped_policy::RETAIN);
+ _optinAction = [optinAction copy];
UIStackView* buttonStack = [[UIStackView alloc]
initWithArrangedSubviews:@[ _dismissButton, _optInButton ]];
[buttonStack setUserInteractionEnabled:YES];
@@ -228,7 +227,7 @@ const CGFloat kDescriptionFontSize = 14;
[[_optInButton widthAnchor]
constraintEqualToAnchor:[_dismissButton widthAnchor]]
.active = YES;
- return [buttonStack autorelease];
+ return buttonStack;
}
- (CGFloat)heightForWidth:(CGFloat)width {
@@ -252,11 +251,13 @@ const CGFloat kDescriptionFontSize = 14;
}
- (void)optInButtonPressed:(id)sender {
- _optinAction.get()();
+ if (_optinAction)
+ _optinAction();
}
- (void)dismissButtonPressed:(id)sender {
- _dismissAction.get()();
+ if (_dismissAction)
+ _dismissAction();
}
@end
« no previous file with comments | « ios/chrome/today_extension/notification_center_url_button.mm ('k') | ios/chrome/today_extension/today_view_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698