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

Unified Diff: chrome/browser/ui/passwords/manage_passwords_ui_controller.h

Issue 2202373002: Ignore OnBubbleHidden() event when the password bubble is reopened. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: delete proxy Created 4 years, 4 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/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);
};

Powered by Google App Engine
This is Rietveld 408576698