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

Unified Diff: chrome/browser/autofill/api/autofill_client.h

Issue 10837363: Introduce AutofillClient and use it to get rid of PasswordManager dependency. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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: chrome/browser/autofill/api/autofill_client.h
diff --git a/chrome/browser/autofill/api/autofill_client.h b/chrome/browser/autofill/api/autofill_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..2a297019e4d5096cb994e9e96a78d052afb89205
--- /dev/null
+++ b/chrome/browser/autofill/api/autofill_client.h
@@ -0,0 +1,44 @@
+// Copyright (c) 2012 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 CHROME_BROWSER_AUTOFILL_API_AUTOFILL_CLIENT_H_
+#define CHROME_BROWSER_AUTOFILL_API_AUTOFILL_CLIENT_H_
+
+class InfoBarTabService;
+class PrefServiceBase;
+
+namespace autofill {
+
+// A delegate interface that needs to be supplied to AutofillManager
+// by the embedder.
+//
+// Each client instance is associated with a given context within
+// which an AutofillManager is used (e.g. a single tab), so when we
+// say "for the client" below, we mean "in the execution context the
+// client is associated with" (e.g. for the tab the AutofillManager is
+// attached to).
+class AutofillClient {
Ilya Sherman 2012/08/22 03:38:03 Hmm, this seems like it is more of a host than a c
+ public:
+ virtual ~AutofillClient() {}
+
+ // Gets the infobar service associated with the client.
+ //
+ // TODO(joi): Given the approach (which we will likely use more
+ // widely) of a context associated with the instance of the client,
+ // it seems right to rename InfoBarTabService to just
+ // InfoBarService. Naming the getter appropriately, will name the
+ // class itself in a follow-up change.
+ virtual InfoBarTabService* GetInfoBarService() = 0;
+
+ // Gets the preferences associated with the client.
+ virtual PrefServiceBase* GetPrefs() = 0;
+
+ // Returns true if saving passwords is currently enabled for the
+ // client.
+ virtual bool IsSavingPasswordsEnabled() = 0;
+};
+
+} // namespace autofill
+
+#endif // CHROME_BROWSER_AUTOFILL_API_AUTOFILL_CLIENT_H_

Powered by Google App Engine
This is Rietveld 408576698