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

Unified Diff: chrome/browser/ui/autofill/autofill_dialog_controller_impl.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/ui/autofill/autofill_dialog_controller_impl.h
diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.h b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.h
index 0d86fa939a3a8d89f3f0832ce6806cddac33e7d6..489589faf2a41307686dab60ea07817ded96b59a 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.h
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.h
@@ -9,6 +9,7 @@
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "base/string16.h"
#include "chrome/browser/autofill/field_types.h"
#include "chrome/browser/autofill/form_structure.h"
@@ -98,13 +99,14 @@ class AutofillDialogControllerImpl : public AutofillDialogController,
virtual content::WebContents* web_contents() OVERRIDE;
// 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;
// content::NotificationObserver implementation:
virtual void Observe(int type,
@@ -254,9 +256,9 @@ class AutofillDialogControllerImpl : public AutofillDialogController,
// The GUIDs for the currently showing unverified profiles popup.
std::vector<PersonalDataManager::GUIDPair> popup_guids_;
- // If non-NULL, the controller for the currently showing popup (which helps
- // users when they're manually filling the dialog).
- AutofillPopupControllerImpl* popup_controller_;
+ // The controller for the currently showing popup (which helps users when
+ // they're manually filling the dialog).
+ base::WeakPtr<AutofillPopupControllerImpl> popup_controller_;
// The section for which |popup_controller_| is currently showing a popup
// (if any).

Powered by Google App Engine
This is Rietveld 408576698