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

Unified Diff: ios/chrome/browser/ui/fade_truncated_label.mm

Issue 2804703002: [ObjC ARC] Converts ios/chrome/browser/ui:ui_internal_arc to ARC. (Closed)
Patch Set: comments 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
« no previous file with comments | « ios/chrome/browser/ui/external_file_remover.mm ('k') | ios/chrome/browser/ui/fullscreen_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/fade_truncated_label.mm
diff --git a/ios/chrome/browser/ui/fade_truncated_label.mm b/ios/chrome/browser/ui/fade_truncated_label.mm
index 8aa4d7da478e54673e0707afc929259c1aa844aa..a0fa29dd5abee591f74751047514b90cbbe98577 100644
--- a/ios/chrome/browser/ui/fade_truncated_label.mm
+++ b/ios/chrome/browser/ui/fade_truncated_label.mm
@@ -5,26 +5,28 @@
#import "ios/chrome/browser/ui/fade_truncated_label.h"
#include <algorithm>
-#include "base/mac/objc_property_releaser.h"
+
#import "ios/chrome/browser/ui/animation_util.h"
#import "ios/chrome/browser/ui/reversed_animation.h"
#import "ui/gfx/ios/uikit_util.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
namespace {
// Animation key used for frame animations.
NSString* const kFadeTruncatedLabelAnimationKey =
@"FadeTruncatedLabelAnimationKey";
}
-@interface FadeTruncatedLabel () {
- base::mac::ObjCPropertyReleaser _propertyReleaser_FadeTruncatedLabel;
-}
+@interface FadeTruncatedLabel ()
// Layer used to apply fade truncation to label.
-@property(nonatomic, retain) CAGradientLayer* maskLayer;
+@property(nonatomic, strong) CAGradientLayer* maskLayer;
// Temporary label used during animations.
-@property(nonatomic, retain) UILabel* animationLabel;
+@property(nonatomic, strong) UILabel* animationLabel;
// Returns the percentage of the label's width at which to begin the fade
// gradient.
@@ -42,9 +44,6 @@ NSString* const kFadeTruncatedLabelAnimationKey =
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
- // Initialize property releaser.
- _propertyReleaser_FadeTruncatedLabel.Init(self, [FadeTruncatedLabel class]);
-
// Set background color and line break mode.
self.backgroundColor = [UIColor clearColor];
self.lineBreakMode = NSLineBreakByClipping;
@@ -101,8 +100,8 @@ NSString* const kFadeTruncatedLabelAnimationKey =
CGSize animationTextSize =
CGSizeMake(std::max(beginFrame.size.width, endFrame.size.width),
std::max(beginFrame.size.height, endFrame.size.height));
- self.animationLabel = [[[UILabel alloc]
- initWithFrame:{CGPointZero, animationTextSize}] autorelease];
+ self.animationLabel =
+ [[UILabel alloc] initWithFrame:{CGPointZero, animationTextSize}];
self.animationLabel.text = self.text;
self.animationLabel.textColor = self.textColor;
self.animationLabel.font = self.font;
« no previous file with comments | « ios/chrome/browser/ui/external_file_remover.mm ('k') | ios/chrome/browser/ui/fullscreen_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698