OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_AUTOFILL_IOS_BROWSER_JS_SUGGESTION_MANAGER_H_ |
| 6 #define COMPONENTS_AUTOFILL_IOS_BROWSER_JS_SUGGESTION_MANAGER_H_ |
| 7 |
| 8 #import "ios/web/public/web_state/js/crw_js_injection_manager.h" |
| 9 |
| 10 @class CRWJSInjectionReceiver; |
| 11 |
| 12 // Loads the JavaScript file, suggestion_manager.js, which contains form parsing |
| 13 // and autofill functions. |
| 14 @interface JsSuggestionManager : CRWJSInjectionManager |
| 15 |
| 16 // Focuses the next focusable element in tab order. No action if there is no |
| 17 // such element. |
| 18 - (void)selectNextElement; |
| 19 |
| 20 // Focuses the next focusable element in tab order after the element specified |
| 21 // by |formName| and |fieldName|. No action if there is no such element. |
| 22 - (void)selectElementAfterForm:(NSString*)formName field:(NSString*)fieldName; |
| 23 |
| 24 // Focuses the previous focusable element in tab order. No action if there is |
| 25 // no such element. |
| 26 - (void)selectPreviousElement; |
| 27 |
| 28 // Focuses the previous focusable element in tab order from the element |
| 29 // specified by |formName| and |fieldName|. No action if there is no such |
| 30 // element. |
| 31 - (void)selectElementBeforeForm:(NSString*)formName field:(NSString*)fieldName; |
| 32 |
| 33 // Injects JS to check if the page contains a next and previous element. |
| 34 // |completionHandler| is called with 2 BOOLs, the first indicating if a |
| 35 // previous element was found, and the second indicating if a next element was |
| 36 // found. |completionHandler| cannot be nil. |
| 37 - (void)fetchPreviousAndNextElementsPresenceWithCompletionHandler: |
| 38 (void (^)(BOOL, BOOL))completionHandler; |
| 39 |
| 40 // Injects JS to check if the page contains a next and previous element |
| 41 // starting from the field specified by |formName| and |fieldName|. |
| 42 // |completionHandler| is called with 2 BOOLs, the first indicating if a |
| 43 // previous element was found, and the second indicating if a next element was |
| 44 // found. |completionHandler| cannot be nil. |
| 45 - (void)fetchPreviousAndNextElementsPresenceForForm:(NSString*)formName |
| 46 field:(NSString*)fieldName |
| 47 completionHandler: |
| 48 (void (^)(BOOL, BOOL))completionHandler; |
| 49 |
| 50 // Closes the keyboard and defocuses the active input element. |
| 51 - (void)closeKeyboard; |
| 52 |
| 53 @end |
| 54 |
| 55 #endif // COMPONENTS_AUTOFILL_IOS_BROWSER_JS_SUGGESTION_MANAGER_H_ |
OLD | NEW |