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

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

Issue 2852413002: Change id to instancetype in FormSuggestion (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #if !defined(__has_feature) || !__has_feature(objc_arc) 7 #if !defined(__has_feature) || !__has_feature(objc_arc)
8 #error "This file requires ARC support." 8 #error "This file requires ARC support."
9 #endif 9 #endif
10 10
11 @interface FormSuggestion () 11 @interface FormSuggestion ()
12 // Local initializer for a FormSuggestion. 12 // Local initializer for a FormSuggestion.
13 - (id)initWithValue:(NSString*)value 13 - (instancetype)initWithValue:(NSString*)value
14 displayDescription:(NSString*)displayDescription 14 displayDescription:(NSString*)displayDescription
15 icon:(NSString*)icon 15 icon:(NSString*)icon
16 identifier:(NSInteger)identifier; 16 identifier:(NSInteger)identifier;
17 @end 17 @end
18 18
19 @implementation FormSuggestion 19 @implementation FormSuggestion
20 20
21 @synthesize value = _value; 21 @synthesize value = _value;
22 @synthesize displayDescription = _displayDescription; 22 @synthesize displayDescription = _displayDescription;
23 @synthesize icon = _icon; 23 @synthesize icon = _icon;
24 @synthesize identifier = _identifier; 24 @synthesize identifier = _identifier;
25 25
26 - (id)initWithValue:(NSString*)value 26 - (instancetype)initWithValue:(NSString*)value
27 displayDescription:(NSString*)displayDescription 27 displayDescription:(NSString*)displayDescription
28 icon:(NSString*)icon 28 icon:(NSString*)icon
29 identifier:(NSInteger)identifier { 29 identifier:(NSInteger)identifier {
30 self = [super init]; 30 self = [super init];
31 if (self) { 31 if (self) {
32 _value = [value copy]; 32 _value = [value copy];
33 _displayDescription = [displayDescription copy]; 33 _displayDescription = [displayDescription copy];
34 _icon = [icon copy]; 34 _icon = [icon copy];
35 _identifier = identifier; 35 _identifier = identifier;
36 } 36 }
37 return self; 37 return self;
38 } 38 }
39 39
40 + (FormSuggestion*)suggestionWithValue:(NSString*)value 40 + (FormSuggestion*)suggestionWithValue:(NSString*)value
41 displayDescription:(NSString*)displayDescription 41 displayDescription:(NSString*)displayDescription
42 icon:(NSString*)icon 42 icon:(NSString*)icon
43 identifier:(NSInteger)identifier { 43 identifier:(NSInteger)identifier {
44 return [[FormSuggestion alloc] initWithValue:value 44 return [[FormSuggestion alloc] initWithValue:value
45 displayDescription:displayDescription 45 displayDescription:displayDescription
46 icon:icon 46 icon:icon
47 identifier:identifier]; 47 identifier:identifier];
48 } 48 }
49 49
50 @end 50 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698