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

Unified Diff: chrome/browser/autofill/autofill_external_delegate.h

Issue 12217024: Use WeakPtr to simplify AutofillPopupControllerImpl memory management (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments and fix test Created 7 years, 10 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/autofill_external_delegate.h
diff --git a/chrome/browser/autofill/autofill_external_delegate.h b/chrome/browser/autofill/autofill_external_delegate.h
index 3dcb020ebd45f312969d8822699bc7914c70a6fe..bcd34ef65186861d3594899ac8860ea01757a487 100644
--- a/chrome/browser/autofill/autofill_external_delegate.h
+++ b/chrome/browser/autofill/autofill_external_delegate.h
@@ -8,6 +8,7 @@
#include <vector>
#include "base/compiler_specific.h"
+#include "base/memory/weak_ptr.h"
#include "base/string16.h"
#include "chrome/browser/autofill/password_autofill_manager.h"
#include "chrome/browser/ui/autofill/autofill_popup_delegate.h"
@@ -47,12 +48,13 @@ class AutofillExternalDelegate
AutofillManager* autofill_manager);
// AutofillPopupDelegate implementation.
+ virtual void OnPopupShown(content::KeyboardListener* listener) OVERRIDE;
+ virtual void OnPopupHidden(content::KeyboardListener* listener) OVERRIDE;
virtual void DidSelectSuggestion(int identifier) OVERRIDE;
virtual void DidAcceptSuggestion(const string16& value,
int identifier) OVERRIDE;
virtual void RemoveSuggestion(const string16& value, int identifier) OVERRIDE;
virtual void ClearPreviewedForm() OVERRIDE;
- virtual void ControllerDestroyed() OVERRIDE;
// Records and associates a query_id with web form data. Called
// when the renderer posts an Autofill query to the browser. |bounds|
@@ -161,7 +163,7 @@ class AutofillExternalDelegate
// The web_contents associated with this delegate.
content::WebContents* web_contents_; // weak; owns me.
AutofillManager* autofill_manager_; // weak.
- AutofillPopupControllerImpl* controller_; // weak.
+ base::WeakPtr<AutofillPopupControllerImpl> controller_;
// Password Autofill manager, handles all password-related Autofilling.
PasswordAutofillManager password_autofill_manager_;

Powered by Google App Engine
This is Rietveld 408576698