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

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

Issue 1137403002: Add upstream bits necessary for iOS card unmask prompt. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix autofill tests on iOS Created 5 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 10
(...skipping 29 matching lines...) Expand all
40 #pragma mark ProtectedMethods 40 #pragma mark ProtectedMethods
41 41
42 - (NSString*)scriptPath { 42 - (NSString*)scriptPath {
43 return @"autofill_controller"; 43 return @"autofill_controller";
44 } 44 }
45 45
46 - (NSString*)presenceBeacon { 46 - (NSString*)presenceBeacon {
47 return @"__gCrWeb.autofill"; 47 return @"__gCrWeb.autofill";
48 } 48 }
49 49
50 - (void)storeActiveElement {
51 NSString* js = @"__gCrWeb.autofill.storeActiveElement()";
52 [self evaluate:js stringResultHandler:nil];
53 }
54
50 - (void)fillActiveFormField:(NSString*)dataString 55 - (void)fillActiveFormField:(NSString*)dataString
51 completionHandler:(ProceduralBlock)completionHandler { 56 completionHandler:(ProceduralBlock)completionHandler {
52 web::JavaScriptCompletion resultHandler = ^void(NSString*, NSError*) { 57 web::JavaScriptCompletion resultHandler = ^void(NSString*, NSError*) {
53 completionHandler(); 58 completionHandler();
54 }; 59 };
55 60
56 NSString* js = 61 NSString* js =
57 [NSString stringWithFormat:@"__gCrWeb.autofill.fillActiveFormField(%@);", 62 [NSString stringWithFormat:@"__gCrWeb.autofill.fillActiveFormField(%@);",
58 dataString]; 63 dataString];
59 [self evaluate:js stringResultHandler:resultHandler]; 64 [self evaluate:js stringResultHandler:resultHandler];
(...skipping 29 matching lines...) Expand all
89 } 94 }
90 95
91 - (void)fillPredictionData:(NSString*)dataString { 96 - (void)fillPredictionData:(NSString*)dataString {
92 [self deferredEvaluate: 97 [self deferredEvaluate:
93 [NSString 98 [NSString
94 stringWithFormat:@"__gCrWeb.autofill.fillPredictionData(%@);", 99 stringWithFormat:@"__gCrWeb.autofill.fillPredictionData(%@);",
95 dataString]]; 100 dataString]];
96 } 101 }
97 102
98 @end 103 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698