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

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: nits 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..5430a38b07818134bfc38d00305506d6cc0cb582 100644
--- a/chrome/browser/ui/passwords/manage_passwords_ui_controller.h
+++ b/chrome/browser/ui/passwords/manage_passwords_ui_controller.h
@@ -32,6 +32,7 @@ class AutoSigninFirstRunPrompt;
class ManagePasswordsIconView;
class PasswordDialogController;
class PasswordDialogControllerImpl;
+class PasswordsModelDelegateProxy;
// Per-tab class to control the Omnibox password icon and bubble.
class ManagePasswordsUIController
@@ -79,7 +80,12 @@ class ManagePasswordsUIController
return bubble_status_ == SHOULD_POP_UP;
}
+ PasswordsModelDelegateProxy* GetModelDelegateProxy() const {
+ return bubble_delegate_proxy_.get();
+ }
+
// 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 +104,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;
@@ -170,6 +176,16 @@ class ManagePasswordsUIController
// The controller for the blocking dialogs.
std::unique_ptr<PasswordDialogControllerImpl> dialog_controller_;
+ // A proxy for the bubble. 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.
vabr (Chromium) 2016/08/05 14:14:04 optional nit: The comment explains the issue, but
vasilii 2016/08/05 16:45:19 Done.
+ std::unique_ptr<PasswordsModelDelegateProxy> bubble_delegate_proxy_;
vabr (Chromium) 2016/08/05 14:14:04 nit: #include <memory> for unique_ptr
vasilii 2016/08/05 16:45:19 Done.
+
BubbleStatus bubble_status_;
DISALLOW_COPY_AND_ASSIGN(ManagePasswordsUIController);

Powered by Google App Engine
This is Rietveld 408576698