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

Unified Diff: chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc

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.cc
diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
index 123704ec7aba365ae787d035aad3804121a4b06e..3f01c9d506bcd7e35df35e55a781cf5cad7d0b82 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
@@ -137,7 +137,6 @@ AutofillDialogControllerImpl::AutofillDialogControllerImpl(
ALLOW_THIS_IN_INITIALIZER_LIST(suggested_cc_(this)),
ALLOW_THIS_IN_INITIALIZER_LIST(suggested_billing_(this)),
ALLOW_THIS_IN_INITIALIZER_LIST(suggested_shipping_(this)),
- popup_controller_(NULL),
section_showing_popup_(SECTION_BILLING) {
// TODO(estade): |this| should observe PersonalDataManager.
// TODO(estade): remove duplicates from |form|?
@@ -582,6 +581,12 @@ content::WebContents* AutofillDialogControllerImpl::web_contents() {
////////////////////////////////////////////////////////////////////////////////
// AutofillPopupDelegate
+void AutofillDialogControllerImpl::OnPopupShown(
+ content::KeyboardListener* listener) {}
+
+void AutofillDialogControllerImpl::OnPopupHidden(
+ content::KeyboardListener* listener) {}
+
void AutofillDialogControllerImpl::DidSelectSuggestion(int identifier) {
// TODO(estade): implement.
}
@@ -617,10 +622,6 @@ void AutofillDialogControllerImpl::ClearPreviewedForm() {
// TODO(estade): implement.
}
-void AutofillDialogControllerImpl::ControllerDestroyed() {
- popup_controller_ = NULL;
-}
-
////////////////////////////////////////////////////////////////////////////////
// content::NotificationObserver
@@ -933,10 +934,8 @@ DetailInputs* AutofillDialogControllerImpl::MutableRequestedFieldsForSection(
}
void AutofillDialogControllerImpl::HidePopup() {
- if (popup_controller_) {
+ if (popup_controller_)
popup_controller_->Hide();
- ControllerDestroyed();
- }
}
} // namespace autofill

Powered by Google App Engine
This is Rietveld 408576698