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

Side by Side Diff: components/autofill/ios/browser/form_suggestion.mm

Issue 2807173003: [ObjC ARC] Converts components/autofill/ios/browser:browser to ARC.
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "components/autofill/ios/browser/form_suggestion.h" 5 #import "components/autofill/ios/browser/form_suggestion.h"
6 6
7 #include "base/mac/objc_property_releaser.h" 7 #if !defined(__has_feature) || !__has_feature(objc_arc)
8 #error "This file requires ARC support."
9 #endif
8 10
9 @interface FormSuggestion () 11 @interface FormSuggestion ()
10 // Local initializer for a FormSuggestion. 12 // Local initializer for a FormSuggestion.
11 - (id)initWithValue:(NSString*)value 13 - (id)initWithValue:(NSString*)value
12 displayDescription:(NSString*)displayDescription 14 displayDescription:(NSString*)displayDescription
13 icon:(NSString*)icon 15 icon:(NSString*)icon
14 identifier:(NSInteger)identifier; 16 identifier:(NSInteger)identifier;
15 @end 17 @end
16 18
17 @implementation FormSuggestion { 19 @implementation FormSuggestion {
18 NSString* _value; 20 NSString* _value;
19 NSString* _displayDescription; 21 NSString* _displayDescription;
stkhapugin 2017/04/11 11:09:16 I think these ivars are no longer necessary and ca
20 NSString* _icon; 22 NSString* _icon;
21 NSInteger _identifier; 23 NSInteger _identifier;
22 base::mac::ObjCPropertyReleaser _propertyReleaser_FormSuggestion;
23 } 24 }
24 25
25 @synthesize value = _value; 26 @synthesize value = _value;
26 @synthesize displayDescription = _displayDescription; 27 @synthesize displayDescription = _displayDescription;
27 @synthesize icon = _icon; 28 @synthesize icon = _icon;
28 @synthesize identifier = _identifier; 29 @synthesize identifier = _identifier;
29 30
30 - (id)initWithValue:(NSString*)value 31 - (id)initWithValue:(NSString*)value
31 displayDescription:(NSString*)displayDescription 32 displayDescription:(NSString*)displayDescription
32 icon:(NSString*)icon 33 icon:(NSString*)icon
33 identifier:(NSInteger)identifier { 34 identifier:(NSInteger)identifier {
34 self = [super init]; 35 self = [super init];
35 if (self) { 36 if (self) {
36 _propertyReleaser_FormSuggestion.Init(self, [FormSuggestion class]);
37 _value = [value copy]; 37 _value = [value copy];
38 _displayDescription = [displayDescription copy]; 38 _displayDescription = [displayDescription copy];
39 _icon = [icon copy]; 39 _icon = [icon copy];
40 _identifier = identifier; 40 _identifier = identifier;
41 } 41 }
42 return self; 42 return self;
43 } 43 }
44 44
45 + (FormSuggestion*)suggestionWithValue:(NSString*)value 45 + (FormSuggestion*)suggestionWithValue:(NSString*)value
46 displayDescription:(NSString*)displayDescription 46 displayDescription:(NSString*)displayDescription
47 icon:(NSString*)icon 47 icon:(NSString*)icon
48 identifier:(NSInteger)identifier { 48 identifier:(NSInteger)identifier {
49 return [[[FormSuggestion alloc] initWithValue:value 49 return [[FormSuggestion alloc] initWithValue:value
50 displayDescription:displayDescription 50 displayDescription:displayDescription
51 icon:icon 51 icon:icon
52 identifier:identifier] autorelease]; 52 identifier:identifier];
53 } 53 }
54 54
55 @end 55 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698