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

Unified Diff: components/autofill/ios/browser/form_suggestion.mm

Issue 1007813002: [iOS] Upstream autofill component code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added dconnelly to OWNERS Created 5 years, 9 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
Index: components/autofill/ios/browser/form_suggestion.mm
diff --git a/components/autofill/ios/browser/form_suggestion.mm b/components/autofill/ios/browser/form_suggestion.mm
new file mode 100644
index 0000000000000000000000000000000000000000..d3f5305f63cbce4226c603d3af9a5ee51eaf57c5
--- /dev/null
+++ b/components/autofill/ios/browser/form_suggestion.mm
@@ -0,0 +1,59 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "components/autofill/ios/browser/form_suggestion.h"
+
+@interface FormSuggestion ()
+// TODO(rohitrao): These properties must be redefined readwrite to work around a
+// clang bug. crbug.com/228650
+@property(copy, readwrite) NSString* value;
+@property(copy, readwrite) NSString* icon;
+
+// Local initializer for a FormSuggestion.
+- (id)initWithValue:(NSString*)value
+ displayDescription:(NSString*)displayDescription
+ icon:(NSString*)icon
+ identifier:(NSUInteger)identifier;
+
+@end
+
+@implementation FormSuggestion {
+ NSString* _value;
+ NSString* _displayDescription;
+ NSString* _icon;
+ NSUInteger _identifier;
+ base::mac::ObjCPropertyReleaser _propertyReleaser_FormSuggestion;
+}
+
+@synthesize value = _value;
+@synthesize displayDescription = _displayDescription;
+@synthesize icon = _icon;
+@synthesize identifier = _identifier;
+
+- (id)initWithValue:(NSString*)value
+ displayDescription:(NSString*)displayDescription
+ icon:(NSString*)icon
+ identifier:(NSUInteger)identifier {
+ self = [super init];
+ if (self) {
+ _propertyReleaser_FormSuggestion.Init(self, [FormSuggestion class]);
+ _value = [value copy];
+ _displayDescription = [displayDescription copy];
+ _icon = [icon copy];
+ _identifier = identifier;
+ }
+ return self;
+}
+
++ (FormSuggestion*)suggestionWithValue:(NSString*)value
+ displayDescription:(NSString*)displayDescription
+ icon:(NSString*)icon
+ identifier:(NSUInteger)identifier {
+ return [[[FormSuggestion alloc] initWithValue:value
+ displayDescription:displayDescription
+ icon:icon
+ identifier:identifier] autorelease];
+}
+
+@end
« no previous file with comments | « components/autofill/ios/browser/form_suggestion.h ('k') | components/autofill/ios/browser/js_autofill_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698