OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #import "components/autofill/ios/browser/form_suggestion.h" |
| 6 |
| 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; |
| 12 |
| 13 // Local initializer for a FormSuggestion. |
| 14 - (id)initWithValue:(NSString*)value |
| 15 displayDescription:(NSString*)displayDescription |
| 16 icon:(NSString*)icon |
| 17 identifier:(NSUInteger)identifier; |
| 18 |
| 19 @end |
| 20 |
| 21 @implementation FormSuggestion { |
| 22 NSString* _value; |
| 23 NSString* _displayDescription; |
| 24 NSString* _icon; |
| 25 NSUInteger _identifier; |
| 26 base::mac::ObjCPropertyReleaser _propertyReleaser_FormSuggestion; |
| 27 } |
| 28 |
| 29 @synthesize value = _value; |
| 30 @synthesize displayDescription = _displayDescription; |
| 31 @synthesize icon = _icon; |
| 32 @synthesize identifier = _identifier; |
| 33 |
| 34 - (id)initWithValue:(NSString*)value |
| 35 displayDescription:(NSString*)displayDescription |
| 36 icon:(NSString*)icon |
| 37 identifier:(NSUInteger)identifier { |
| 38 self = [super init]; |
| 39 if (self) { |
| 40 _propertyReleaser_FormSuggestion.Init(self, [FormSuggestion class]); |
| 41 _value = [value copy]; |
| 42 _displayDescription = [displayDescription copy]; |
| 43 _icon = [icon copy]; |
| 44 _identifier = identifier; |
| 45 } |
| 46 return self; |
| 47 } |
| 48 |
| 49 + (FormSuggestion*)suggestionWithValue:(NSString*)value |
| 50 displayDescription:(NSString*)displayDescription |
| 51 icon:(NSString*)icon |
| 52 identifier:(NSUInteger)identifier { |
| 53 return [[[FormSuggestion alloc] initWithValue:value |
| 54 displayDescription:displayDescription |
| 55 icon:icon |
| 56 identifier:identifier] autorelease]; |
| 57 } |
| 58 |
| 59 @end |
OLD | NEW |