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
3 // found in the LICENSE file.
5 #import "components/autofill/ios/browser/form_suggestion.h"
7 @interface FormSuggestion ()
8 // TODO(rohitrao): These properties must be redefined readwrite to work around a
9 // clang bug. crbug.com/228650
10 @property(copy, readwrite) NSString* value;
11 @property(copy, readwrite) NSString* icon;
13 // Local initializer for a FormSuggestion.
14 - (id)initWithValue:(NSString*)value
15 displayDescription:(NSString*)displayDescription
17 identifier:(NSInteger)identifier;
21 @implementation FormSuggestion {
23 NSString* _displayDescription;
25 NSInteger _identifier;
26 base::mac::ObjCPropertyReleaser _propertyReleaser_FormSuggestion;
29 @synthesize value = _value;
30 @synthesize displayDescription = _displayDescription;
31 @synthesize icon = _icon;
32 @synthesize identifier = _identifier;
34 - (id)initWithValue:(NSString*)value
35 displayDescription:(NSString*)displayDescription
37 identifier:(NSInteger)identifier {
40 _propertyReleaser_FormSuggestion.Init(self, [FormSuggestion class]);
41 _value = [value copy];
42 _displayDescription = [displayDescription copy];
44 _identifier = identifier;
49 + (FormSuggestion*)suggestionWithValue:(NSString*)value
50 displayDescription:(NSString*)displayDescription
52 identifier:(NSInteger)identifier {
53 return [[[FormSuggestion alloc] initWithValue:value
54 displayDescription:displayDescription
56 identifier:identifier] autorelease];