| OLD | NEW |
| 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 #ifndef COMPONENTS_AUTOFILL_IOS_BROWSER_JS_AUTOFILL_MANAGER_H_ | 5 #ifndef COMPONENTS_AUTOFILL_IOS_BROWSER_JS_AUTOFILL_MANAGER_H_ |
| 6 #define COMPONENTS_AUTOFILL_IOS_BROWSER_JS_AUTOFILL_MANAGER_H_ | 6 #define COMPONENTS_AUTOFILL_IOS_BROWSER_JS_AUTOFILL_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/ios/block_types.h" | 8 #include "base/ios/block_types.h" |
| 9 #include "components/autofill/core/common/autofill_constants.h" | 9 #include "components/autofill/core/common/autofill_constants.h" |
| 10 #import "ios/web/public/web_state/js/crw_js_injection_manager.h" | 10 #import "ios/web/public/web_state/js/crw_js_injection_manager.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 - (void)clearActiveElement; | 40 - (void)clearActiveElement; |
| 41 | 41 |
| 42 // Fills the data in JSON string |dataString| into the active form field, then | 42 // Fills the data in JSON string |dataString| into the active form field, then |
| 43 // executes the |completionHandler|. The active form field is either | 43 // executes the |completionHandler|. The active form field is either |
| 44 // document.activeElement or the field stored by a call to storeActiveElement. | 44 // document.activeElement or the field stored by a call to storeActiveElement. |
| 45 // non-null. | 45 // non-null. |
| 46 - (void)fillActiveFormField:(NSString*)dataString | 46 - (void)fillActiveFormField:(NSString*)dataString |
| 47 completionHandler:(ProceduralBlock)completionHandler; | 47 completionHandler:(ProceduralBlock)completionHandler; |
| 48 | 48 |
| 49 // Fills a number of fields in the same named form. | 49 // Fills a number of fields in the same named form. |
| 50 // If |onlyFillEmpty| is true then only empty fields will be filled. Otherwise |
| 51 // all fields will be filled. |
| 52 // Field named |forceFillFieldName| will always be filled, regardless of value |
| 53 // of |onlyFillEmpty|. May be null. |
| 50 // Applies Autofill CSS (i.e. yellow background) to filled elements if | 54 // Applies Autofill CSS (i.e. yellow background) to filled elements if |
| 51 // |styleElements| is true. | 55 // |styleElements| is true. |
| 52 // |completionHandler| is called after the forms are filled. |completionHandler| | 56 // |completionHandler| is called after the forms are filled. |completionHandler| |
| 53 // cannot be nil. | 57 // cannot be nil. |
| 54 - (void)fillForm:(NSString*)dataString | 58 - (void)fillForm:(NSString*)dataString |
| 55 styleElements:(BOOL)styleElements | 59 onlyFillEmpty:(BOOL)onlyFillEmpty |
| 56 completionHandler:(ProceduralBlock)completionHandler; | 60 forceFillFieldName:(NSString*)forceFillFieldName |
| 61 styleElements:(BOOL)styleElements |
| 62 completionHandler:(ProceduralBlock)completionHandler; |
| 57 | 63 |
| 58 // Dispatches the autocomplete event to the form element with the given | 64 // Dispatches the autocomplete event to the form element with the given |
| 59 // |formName|. | 65 // |formName|. |
| 60 - (void)dispatchAutocompleteEvent:(NSString*)formName; | 66 - (void)dispatchAutocompleteEvent:(NSString*)formName; |
| 61 | 67 |
| 62 // Dispatches the autocomplete error event to the form element with the given | 68 // Dispatches the autocomplete error event to the form element with the given |
| 63 // |formName|, supplying the given reason. | 69 // |formName|, supplying the given reason. |
| 64 - (void)dispatchAutocompleteErrorEvent:(NSString*)formName | 70 - (void)dispatchAutocompleteErrorEvent:(NSString*)formName |
| 65 withReason:(NSString*)reason; | 71 withReason:(NSString*)reason; |
| 66 | 72 |
| 67 // Marks up the form with autofill field prediction data (diagnostic tool). | 73 // Marks up the form with autofill field prediction data (diagnostic tool). |
| 68 - (void)fillPredictionData:(NSString*)dataString; | 74 - (void)fillPredictionData:(NSString*)dataString; |
| 69 | 75 |
| 70 @end | 76 @end |
| 71 | 77 |
| 72 #endif // COMPONENTS_AUTOFILL_IOS_BROWSER_JS_AUTOFILL_MANAGER_H_ | 78 #endif // COMPONENTS_AUTOFILL_IOS_BROWSER_JS_AUTOFILL_MANAGER_H_ |
| OLD | NEW |