| Index: chrome/browser/ui/autofill/autofill_popup_controller_impl.h
|
| diff --git a/chrome/browser/ui/autofill/autofill_popup_controller_impl.h b/chrome/browser/ui/autofill/autofill_popup_controller_impl.h
|
| index d0ab107e7bbff6a4958398c57ffb04b117b2ac2e..131b124a5bde5c004acf3d050cc2600297804db6 100644
|
| --- a/chrome/browser/ui/autofill/autofill_popup_controller_impl.h
|
| +++ b/chrome/browser/ui/autofill/autofill_popup_controller_impl.h
|
| @@ -6,6 +6,7 @@
|
| #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_IMPL_H_
|
|
|
| #include "base/gtest_prod_util.h"
|
| +#include "base/memory/weak_ptr.h"
|
| #include "base/string16.h"
|
| #include "chrome/browser/ui/autofill/autofill_popup_controller.h"
|
| #include "content/public/browser/keyboard_listener.h"
|
| @@ -32,8 +33,8 @@ class AutofillPopupControllerImpl : public AutofillPopupController,
|
| // Creates a new |AutofillPopupControllerImpl|, or reuses |previous| if
|
| // the construction arguments are the same. |previous| may be invalidated by
|
| // this call.
|
| - static AutofillPopupControllerImpl* GetOrCreate(
|
| - AutofillPopupControllerImpl* previous,
|
| + static base::WeakPtr<AutofillPopupControllerImpl> GetOrCreate(
|
| + base::WeakPtr<AutofillPopupControllerImpl> previous,
|
| AutofillPopupDelegate* delegate,
|
| gfx::NativeView container_view,
|
| const gfx::Rect& element_bounds);
|
| @@ -86,10 +87,6 @@ class AutofillPopupControllerImpl : public AutofillPopupController,
|
| virtual int selected_line() const OVERRIDE;
|
| virtual bool delete_icon_hovered() const OVERRIDE;
|
|
|
| - // Like Hide(), but doesn't invalidate |delegate_| (the delegate will still
|
| - // be informed of destruction).
|
| - void HideInternal();
|
| -
|
| // Change which line is currently selected by the user.
|
| void SetSelectedLine(int selected_line);
|
|
|
| @@ -136,6 +133,8 @@ class AutofillPopupControllerImpl : public AutofillPopupController,
|
| int GetDesiredPopupHeight() const;
|
| #endif
|
|
|
| + base::WeakPtr<AutofillPopupControllerImpl> GetWeakPtr();
|
| +
|
| private:
|
| #if !defined(OS_ANDROID)
|
| // Calculate the width of the row, excluding all the text. This provides
|
| @@ -203,8 +202,7 @@ class AutofillPopupControllerImpl : public AutofillPopupController,
|
| // True if |HideInternal| has already been called.
|
| bool is_hiding_;
|
|
|
| - // True if the delegate should be informed when |this| is destroyed.
|
| - bool inform_delegate_of_destruction_;
|
| + base::WeakPtrFactory<AutofillPopupControllerImpl> weak_ptr_factory_;
|
| };
|
|
|
| #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_IMPL_H_
|
|
|