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

Unified Diff: ios/chrome/browser/autofill/form_suggestion_view.mm

Issue 2933093003: [ObjC ARC] Converts ios/chrome/browser/autofill:autofill to ARC. (Closed)
Patch Set: Fix nil assignment. 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
« no previous file with comments | « ios/chrome/browser/autofill/form_suggestion_label.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/autofill/form_suggestion_view.mm
diff --git a/ios/chrome/browser/autofill/form_suggestion_view.mm b/ios/chrome/browser/autofill/form_suggestion_view.mm
index e7d1716d4b541af98eb844bc5114a29a1e9ba127..8c77f37ac247207ef5bc36cdf2d162964a642936 100644
--- a/ios/chrome/browser/autofill/form_suggestion_view.mm
+++ b/ios/chrome/browser/autofill/form_suggestion_view.mm
@@ -5,11 +5,14 @@
#import "ios/chrome/browser/autofill/form_suggestion_view.h"
#include "base/i18n/rtl.h"
-#include "base/mac/scoped_nsobject.h"
#import "components/autofill/ios/browser/form_suggestion.h"
#import "ios/chrome/browser/autofill/form_suggestion_label.h"
#import "ios/chrome/browser/autofill/form_suggestion_view_client.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
namespace {
// Vertical margin between suggestions and the edge of the suggestion content
@@ -24,7 +27,7 @@ const CGFloat kSuggestionHorizontalMargin = 6;
@implementation FormSuggestionView {
// The FormSuggestions that are displayed by this view.
- base::scoped_nsobject<NSArray> _suggestions;
+ NSArray* _suggestions;
}
- (instancetype)initWithFrame:(CGRect)frame
@@ -32,7 +35,7 @@ const CGFloat kSuggestionHorizontalMargin = 6;
suggestions:(NSArray*)suggestions {
self = [super initWithFrame:frame];
if (self) {
- _suggestions.reset([suggestions copy]);
+ _suggestions = [suggestions copy];
self.showsVerticalScrollIndicator = NO;
self.showsHorizontalScrollIndicator = NO;
@@ -50,12 +53,12 @@ const CGFloat kSuggestionHorizontalMargin = 6;
// the width.
CGRect proposedFrame =
CGRectMake(currentX, kSuggestionVerticalMargin, 0, labelHeight);
- base::scoped_nsobject<UIView> label([[FormSuggestionLabel alloc]
+ UIView* label = [[FormSuggestionLabel alloc]
initWithSuggestion:suggestion
proposedFrame:proposedFrame
index:idx
numSuggestions:[_suggestions count]
- client:client]);
+ client:client];
[self addSubview:label];
currentX +=
CGRectGetWidth([label frame]) + kSuggestionHorizontalMargin;
@@ -97,7 +100,7 @@ const CGFloat kSuggestionHorizontalMargin = 6;
}
- (NSArray*)suggestions {
- return _suggestions.get();
+ return _suggestions;
}
@end
« no previous file with comments | « ios/chrome/browser/autofill/form_suggestion_label.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698