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

Unified Diff: ios/chrome/browser/autofill/autofill_controller.h

Issue 2580363002: Upstream Chrome on iOS source code [1/11]. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « ios/chrome/browser/autofill/autofill_agent.mm ('k') | ios/chrome/browser/autofill/autofill_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/autofill/autofill_controller.h
diff --git a/ios/chrome/browser/autofill/autofill_controller.h b/ios/chrome/browser/autofill/autofill_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..32ed16ead90602850e97e42f9589265658ca3c56
--- /dev/null
+++ b/ios/chrome/browser/autofill/autofill_controller.h
@@ -0,0 +1,70 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+#ifndef IOS_CHROME_BROWSER_AUTOFILL_AUTOFILL_CONTROLLER_H_
+#define IOS_CHROME_BROWSER_AUTOFILL_AUTOFILL_CONTROLLER_H_
+
+#import <UIKit/UIKit.h>
+#include <vector>
+
+#import "ios/chrome/browser/autofill/form_suggestion_provider.h"
+
+@class AutofillAgent;
+@protocol FormSuggestionProvider;
+
+namespace autofill {
+class FormStructure;
+}
+
+namespace ios {
+class ChromeBrowserState;
+}
+
+namespace password_manager {
+class PasswordGenerationManager;
+}
+
+namespace web {
+class WebState;
+}
+
+// Handles Autofill.
+@interface AutofillController : NSObject
+
+@property(nonatomic, readonly) ios::ChromeBrowserState* browserState;
+@property(weak, nonatomic, readonly) id<FormSuggestionProvider>
+ suggestionProvider;
+
+// Designated initializer. Neither |browserState| nor |webState| should be null.
+// |downloadEnabled| should be NO for tests to stop the system making external
+// network requests.
+- (instancetype)
+ initWithBrowserState:(ios::ChromeBrowserState*)browserState
+ webState:(web::WebState*)webState
+ autofillAgent:(AutofillAgent*)autofillAgent
+passwordGenerationManager:
+ (password_manager::PasswordGenerationManager*)passwordGenerationManager
+ downloadEnabled:(BOOL)downloadEnabled NS_DESIGNATED_INITIALIZER;
+
+// Convenience initializer. The autofill agent will be created from the
+// given webstate.
+// The system will start making external network requests.
+- (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState
+ passwordGenerationManager:
+ (password_manager::PasswordGenerationManager*)
+ passwordGenerationManager
+ webState:(web::WebState*)webState;
+
+- (instancetype)init NS_UNAVAILABLE;
+
+// Detaches itself from the supplied |webState|.
+- (void)detachFromWebState;
+
+// Sends the field type predictions specified in |forms| to the renderer. This
+// method is a no-op if the appropriate experiment is not set.
+- (void)sendAutofillTypePredictionsToRenderer:
+ (const std::vector<autofill::FormStructure*>&)forms;
+
+@end
+
+#endif // IOS_CHROME_BROWSER_AUTOFILL_AUTOFILL_CONTROLLER_H_
« no previous file with comments | « ios/chrome/browser/autofill/autofill_agent.mm ('k') | ios/chrome/browser/autofill/autofill_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698