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 #ifndef IOS_CHROME_BROWSER_AUTOFILL_AUTOFILL_CONTROLLER_H_ |
| 5 #define IOS_CHROME_BROWSER_AUTOFILL_AUTOFILL_CONTROLLER_H_ |
| 6 |
| 7 #import <UIKit/UIKit.h> |
| 8 #include <vector> |
| 9 |
| 10 #import "ios/chrome/browser/autofill/form_suggestion_provider.h" |
| 11 |
| 12 @class AutofillAgent; |
| 13 @protocol FormSuggestionProvider; |
| 14 |
| 15 namespace autofill { |
| 16 class FormStructure; |
| 17 } |
| 18 |
| 19 namespace ios { |
| 20 class ChromeBrowserState; |
| 21 } |
| 22 |
| 23 namespace password_manager { |
| 24 class PasswordGenerationManager; |
| 25 } |
| 26 |
| 27 namespace web { |
| 28 class WebState; |
| 29 } |
| 30 |
| 31 // Handles Autofill. |
| 32 @interface AutofillController : NSObject |
| 33 |
| 34 @property(nonatomic, readonly) ios::ChromeBrowserState* browserState; |
| 35 @property(weak, nonatomic, readonly) id<FormSuggestionProvider> |
| 36 suggestionProvider; |
| 37 |
| 38 // Designated initializer. Neither |browserState| nor |webState| should be null. |
| 39 // |downloadEnabled| should be NO for tests to stop the system making external |
| 40 // network requests. |
| 41 - (instancetype) |
| 42 initWithBrowserState:(ios::ChromeBrowserState*)browserState |
| 43 webState:(web::WebState*)webState |
| 44 autofillAgent:(AutofillAgent*)autofillAgent |
| 45 passwordGenerationManager: |
| 46 (password_manager::PasswordGenerationManager*)passwordGenerationManager |
| 47 downloadEnabled:(BOOL)downloadEnabled NS_DESIGNATED_INITIALIZER; |
| 48 |
| 49 // Convenience initializer. The autofill agent will be created from the |
| 50 // given webstate. |
| 51 // The system will start making external network requests. |
| 52 - (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState |
| 53 passwordGenerationManager: |
| 54 (password_manager::PasswordGenerationManager*) |
| 55 passwordGenerationManager |
| 56 webState:(web::WebState*)webState; |
| 57 |
| 58 - (instancetype)init NS_UNAVAILABLE; |
| 59 |
| 60 // Detaches itself from the supplied |webState|. |
| 61 - (void)detachFromWebState; |
| 62 |
| 63 // Sends the field type predictions specified in |forms| to the renderer. This |
| 64 // method is a no-op if the appropriate experiment is not set. |
| 65 - (void)sendAutofillTypePredictionsToRenderer: |
| 66 (const std::vector<autofill::FormStructure*>&)forms; |
| 67 |
| 68 @end |
| 69 |
| 70 #endif // IOS_CHROME_BROWSER_AUTOFILL_AUTOFILL_CONTROLLER_H_ |
OLD | NEW |