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

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

Issue 2849533003: [ObjC ARC] Converts components/autofill/ios/browser:browser to ARC. (Closed)
Patch Set: Address comments 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
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/js_autofill_manager.h" 5 #import "components/autofill/ios/browser/js_autofill_manager.h"
6 6
7 #include "base/format_macros.h" 7 #include "base/format_macros.h"
8 #include "base/json/string_escape.h" 8 #include "base/json/string_escape.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/mac/foundation_util.h" 10 #include "base/mac/foundation_util.h"
11 11
12 #if !defined(__has_feature) || !__has_feature(objc_arc)
13 #error "This file requires ARC support."
14 #endif
15
12 @implementation JsAutofillManager 16 @implementation JsAutofillManager
13 17
14 - (void)fetchFormsWithMinimumRequiredFieldsCount:(NSUInteger)requiredFieldsCount 18 - (void)fetchFormsWithMinimumRequiredFieldsCount:(NSUInteger)requiredFieldsCount
15 completionHandler: 19 completionHandler:
16 (void (^)(NSString*))completionHandler { 20 (void (^)(NSString*))completionHandler {
17 DCHECK(completionHandler); 21 DCHECK(completionHandler);
18 NSString* extractFormsJS = [NSString 22 NSString* extractFormsJS = [NSString
19 stringWithFormat:@"__gCrWeb.autofill.extractForms(%" PRIuNS ");", 23 stringWithFormat:@"__gCrWeb.autofill.extractForms(%" PRIuNS ");",
20 requiredFieldsCount]; 24 requiredFieldsCount];
21 [self executeJavaScript:extractFormsJS 25 [self executeJavaScript:extractFormsJS
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 } 74 }
71 75
72 - (void)fillPredictionData:(NSString*)dataString { 76 - (void)fillPredictionData:(NSString*)dataString {
73 NSString* script = 77 NSString* script =
74 [NSString stringWithFormat:@"__gCrWeb.autofill.fillPredictionData(%@);", 78 [NSString stringWithFormat:@"__gCrWeb.autofill.fillPredictionData(%@);",
75 dataString]; 79 dataString];
76 [self executeJavaScript:script completionHandler:nil]; 80 [self executeJavaScript:script completionHandler:nil];
77 } 81 }
78 82
79 @end 83 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698