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

Unified Diff: ios/chrome/browser/ui/omnibox/truncating_attributed_label.mm

Issue 2707963002: [ObjC ARC] Converts ios/chrome/browser/ui/omnibox:omnibox_internal to ARC. (Closed)
Patch Set: weaks Created 3 years, 10 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/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 c4a13e49895e5c9e4f4fb2d622700fc8b1bbc867..b5e91ed6994e551ae510cf18a30717e857ff3456 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,11 +19,9 @@
@implementation OmniboxPopupTruncatingLabel {
// Attributed text.
- base::scoped_nsobject<CATextLayer> textLayer_;
+ CATextLayer* textLayer_;
// 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_;
@@ -35,9 +36,9 @@
truncateMode_ = OmniboxPopupTruncatingTail;
// Disable animations in CATextLayer.
- textLayer_.reset([[CATextLayer layer] retain]);
- base::scoped_nsobject<NSDictionary> actions([[NSDictionary alloc]
- initWithObjectsAndKeys:[NSNull null], @"contents", nil]);
+ textLayer_ = [CATextLayer layer];
+ NSDictionary* actions = [[NSDictionary alloc]
+ initWithObjectsAndKeys:[NSNull null], @"contents", nil];
[textLayer_ setActions:actions];
[textLayer_ setFrame:self.bounds];
[textLayer_ setContentsScale:[[UIScreen mainScreen] scale]];
@@ -46,8 +47,6 @@
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
- propertyReleaser_OmniboxPopupTruncatingLabel_.Init(
- self, [OmniboxPopupTruncatingLabel class]);
[self setup];
}
return self;
@@ -64,9 +63,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];
}
}
@@ -97,7 +96,7 @@
NOTREACHED();
}
if (textAlignment != textAlignment_)
- gradient_.reset();
+ gradient_ = nil;
textAlignment_ = textAlignment;
}

Powered by Google App Engine
This is Rietveld 408576698