| Index: chrome/browser/ui/passwords/manage_passwords_ui_controller.h
|
| diff --git a/chrome/browser/ui/passwords/manage_passwords_ui_controller.h b/chrome/browser/ui/passwords/manage_passwords_ui_controller.h
|
| index 802aa5b0517c2fbf96b04823b0bf9db4d2ef13fe..d075a487946ab3c98dfb722f24f0d9391af7b4d9 100644
|
| --- a/chrome/browser/ui/passwords/manage_passwords_ui_controller.h
|
| +++ b/chrome/browser/ui/passwords/manage_passwords_ui_controller.h
|
| @@ -5,6 +5,7 @@
|
| #ifndef CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_H_
|
| #define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_UI_CONTROLLER_H_
|
|
|
| +#include <memory>
|
| #include <vector>
|
|
|
| #include "base/macros.h"
|
| @@ -79,7 +80,10 @@ class ManagePasswordsUIController
|
| return bubble_status_ == SHOULD_POP_UP;
|
| }
|
|
|
| + base::WeakPtr<PasswordsModelDelegate> GetModelDelegateProxy();
|
| +
|
| // PasswordsModelDelegate:
|
| + content::WebContents* GetWebContents() const override;
|
| const GURL& GetOrigin() const override;
|
| password_manager::ui::State GetState() const override;
|
| const autofill::PasswordForm& GetPendingPassword() const override;
|
| @@ -98,7 +102,7 @@ class ManagePasswordsUIController
|
| void SavePassword() override;
|
| void UpdatePassword(const autofill::PasswordForm& password_form) override;
|
| void ChooseCredential(
|
| - autofill::PasswordForm form,
|
| + const autofill::PasswordForm& form,
|
| password_manager::CredentialType credential_type) override;
|
| void NavigateToExternalPasswordManager() override;
|
| void NavigateToSmartLockHelpPage() override;
|
| @@ -172,6 +176,17 @@ class ManagePasswordsUIController
|
|
|
| BubbleStatus bubble_status_;
|
|
|
| + // The bubbles of different types can pop up unpredictably superseding each
|
| + // other. However, closing the bubble may affect the state of
|
| + // ManagePasswordsUIController internally. This is undesired if
|
| + // ManagePasswordsUIController is in the process of opening a new bubble. The
|
| + // situation is worse on Windows where the bubble is destroyed asynchronously.
|
| + // Thus, OnBubbleHidden() can be called after the new one is shown. By that
|
| + // time the internal state of ManagePasswordsUIController has nothing to do
|
| + // with the old bubble.
|
| + // Invalidating all the weak pointers will detach the current bubble.
|
| + base::WeakPtrFactory<ManagePasswordsUIController> weak_ptr_factory_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(ManagePasswordsUIController);
|
| };
|
|
|
|
|