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

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: ARC in new code Created 3 years, 9 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/omnibox/page_info_view_controller.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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];
}
« no previous file with comments | « ios/chrome/browser/ui/omnibox/page_info_view_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698