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

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

Issue 1234193005: iOS full-form Autofill: Handle partially filled forms correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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/js_autofill_manager.mm
diff --git a/components/autofill/ios/browser/js_autofill_manager.mm b/components/autofill/ios/browser/js_autofill_manager.mm
index 3a84762e818f36368f3b8ddc316e336fb01c749a..4f1f15cbb46640c1955efbf330ac8f65253607b4 100644
--- a/components/autofill/ios/browser/js_autofill_manager.mm
+++ b/components/autofill/ios/browser/js_autofill_manager.mm
@@ -78,12 +78,19 @@
}
- (void)fillForm:(NSString*)dataString
- styleElements:(BOOL)styleElements
- completionHandler:(ProceduralBlock)completionHandler {
+ onlyFillEmpty:(BOOL)onlyFillEmpty
+ forceFillFieldName:(NSString*)forceFillFieldName
+ styleElements:(BOOL)styleElements
+ completionHandler:(ProceduralBlock)completionHandler {
DCHECK(completionHandler);
- NSString* fillFormJS =
- [NSString stringWithFormat:@"__gCrWeb.autofill.fillForm(%@, %s);",
- dataString, styleElements ? "true" : "false"];
+ std::string fieldName =
+ forceFillFieldName
+ ? base::GetQuotedJSONString([forceFillFieldName UTF8String])
+ : "null";
+ NSString* fillFormJS = [NSString
+ stringWithFormat:@"__gCrWeb.autofill.fillForm(%@, %s, %s, %s);",
+ dataString, onlyFillEmpty ? "true" : "false",
+ fieldName.c_str(), styleElements ? "true" : "false"];
id stringResultHandler = ^(NSString*, NSError*) {
completionHandler();
};

Powered by Google App Engine
This is Rietveld 408576698