Index: ios/chrome/browser/ui/omnibox/truncating_attributed_label.mm |
diff --git a/ios/chrome/browser/ui/omnibox/truncating_attributed_label.mm b/ios/chrome/browser/ui/omnibox/truncating_attributed_label.mm |
index 0474a6143ce81462df6930875db980bfa9091af2..213a0f61b57c584144340b3813b20d4003125cbf 100644 |
--- a/ios/chrome/browser/ui/omnibox/truncating_attributed_label.mm |
+++ b/ios/chrome/browser/ui/omnibox/truncating_attributed_label.mm |
@@ -6,9 +6,12 @@ |
#include <algorithm> |
-#include "base/mac/objc_property_releaser.h" |
#include "base/mac/scoped_cftyperef.h" |
+#if !defined(__has_feature) || !__has_feature(objc_arc) |
+#error "This file requires ARC support." |
+#endif |
+ |
@interface OmniboxPopupTruncatingLabel () |
- (void)setup; |
- (UIImage*)getLinearGradient:(CGRect)rect; |
@@ -16,9 +19,7 @@ |
@implementation OmniboxPopupTruncatingLabel { |
// Gradient used to create fade effect. Changes based on view.frame size. |
- base::scoped_nsobject<UIImage> gradient_; |
- |
- base::mac::ObjCPropertyReleaser propertyReleaser_OmniboxPopupTruncatingLabel_; |
+ UIImage* gradient_; |
} |
@synthesize truncateMode = truncateMode_; |
@@ -31,8 +32,6 @@ |
- (id)initWithFrame:(CGRect)frame { |
self = [super initWithFrame:frame]; |
if (self) { |
- propertyReleaser_OmniboxPopupTruncatingLabel_.Init( |
- self, [OmniboxPopupTruncatingLabel class]); |
self.lineBreakMode = NSLineBreakByClipping; |
[self setup]; |
} |
@@ -49,9 +48,9 @@ |
// Cache the fade gradient when the frame changes. |
if (!CGRectIsEmpty(frame) && |
- (!gradient_.get() || !CGSizeEqualToSize([gradient_ size], frame.size))) { |
+ (!gradient_ || !CGSizeEqualToSize([gradient_ size], frame.size))) { |
CGRect rect = CGRectMake(0, 0, frame.size.width, frame.size.height); |
- gradient_.reset([[self getLinearGradient:rect] retain]); |
+ gradient_ = [self getLinearGradient:rect]; |
} |
} |
@@ -66,9 +65,9 @@ |
// Add the specified line break and alignment attributes to attributedText and |
// draw the result. |
NSMutableAttributedString* attributedString = |
- [[self.attributedText mutableCopy] autorelease]; |
+ [self.attributedText mutableCopy]; |
NSMutableParagraphStyle* textStyle = |
- [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] autorelease]; |
+ [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; |
textStyle.lineBreakMode = self.lineBreakMode; |
textStyle.alignment = self.textAlignment; |
[attributedString addAttribute:NSParagraphStyleAttributeName |
@@ -91,7 +90,7 @@ |
} |
if (textAlignment != self.textAlignment) |
- gradient_.reset(); |
+ gradient_ = nil; |
[super setTextAlignment:textAlignment]; |
} |