Index: chrome/browser/autofill/autofill_manager.h |
diff --git a/chrome/browser/autofill/autofill_manager.h b/chrome/browser/autofill/autofill_manager.h |
index 57af9b334b8a3eed7babffdb2de3c1e62b780778..565e844bc66ac9de5ce4428ea86c658d75de65f7 100644 |
--- a/chrome/browser/autofill/autofill_manager.h |
+++ b/chrome/browser/autofill/autofill_manager.h |
@@ -36,7 +36,6 @@ class CreditCard; |
class PersonalDataManager; |
class PrefService; |
class ProfileSyncService; |
-class TabContents; |
struct ViewHostMsg_FrameNavigate_Params; |
@@ -47,6 +46,7 @@ class PasswordGenerator; |
namespace content { |
class RenderViewHost; |
+class WebContents; |
} |
namespace gfx { |
@@ -74,10 +74,10 @@ class AutofillManager : public content::NotificationObserver, |
public ProfileSyncServiceObserver, |
public base::RefCounted<AutofillManager> { |
public: |
- // Lifetime of |client| and |tab_contents| must exceed lifetime of |
- // AutofillManager. |
- explicit AutofillManager(autofill::AutofillManagerDelegate* delegate, |
- TabContents* tab_contents); |
+ static void CreateForWebContentsAndDelegate( |
+ content::WebContents* contents, |
+ autofill::AutofillManagerDelegate* delegate); |
+ static AutofillManager* FromWebContents(content::WebContents* contents); |
// Registers our Enable/Disable Autofill pref. |
static void RegisterUserPrefs(PrefServiceBase* prefs); |
@@ -113,6 +113,9 @@ class AutofillManager : public content::NotificationObserver, |
protected: |
// Only test code should subclass AutofillManager. |
friend class base::RefCounted<AutofillManager>; |
+ |
+ AutofillManager(content::WebContents* web_contents, |
+ autofill::AutofillManagerDelegate* delegate); |
virtual ~AutofillManager(); |
// The string/int pair is composed of the guid string and variant index |
@@ -121,8 +124,8 @@ class AutofillManager : public content::NotificationObserver, |
typedef std::pair<std::string, size_t> GUIDPair; |
// Test code should prefer to use this constructor. |
- AutofillManager(autofill::AutofillManagerDelegate* delegate, |
- TabContents* tab_contents, |
+ AutofillManager(content::WebContents* web_contents, |
+ autofill::AutofillManagerDelegate* delegate, |
PersonalDataManager* personal_data); |
// Returns the value of the AutofillEnabled pref. |
@@ -328,9 +331,6 @@ class AutofillManager : public content::NotificationObserver, |
autofill::AutofillManagerDelegate* const manager_delegate_; |
- // The owning TabContents. |
- TabContents* tab_contents_; |
- |
// The personal data manager, used to save and load personal data to/from the |
// web database. This is overridden by the AutofillManagerTest. |
// Weak reference. |