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

Unified Diff: chrome/browser/ui/passwords/passwords_model_delegate_proxy.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/passwords_model_delegate_proxy.h
diff --git a/chrome/browser/ui/passwords/passwords_model_delegate_proxy.h b/chrome/browser/ui/passwords/passwords_model_delegate_proxy.h
new file mode 100644
index 0000000000000000000000000000000000000000..ad46fe5d828d2ea90650eb5e44355f6017e41d2b
--- /dev/null
+++ b/chrome/browser/ui/passwords/passwords_model_delegate_proxy.h
@@ -0,0 +1,60 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_PASSWORDS_PASSWORDS_MODEL_DELEGATE_PROXY_H_
+#define CHROME_BROWSER_UI_PASSWORDS_PASSWORDS_MODEL_DELEGATE_PROXY_H_
+
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "chrome/browser/ui/passwords/passwords_model_delegate.h"
+
+// The class simply delegates all the calls to its delegate. It supports weak
+// pointer ownership.
+class PasswordsModelDelegateProxy
+ : public PasswordsModelDelegate,
+ public base::SupportsWeakPtr<PasswordsModelDelegateProxy> {
+ public:
+ explicit PasswordsModelDelegateProxy(PasswordsModelDelegate* delegate);
+ ~PasswordsModelDelegateProxy() override;
+
+ // PasswordsModelDelegate:
+ content::WebContents* GetWebContents() const override;
+ const GURL& GetOrigin() const override;
+ password_manager::ui::State GetState() const override;
+ const autofill::PasswordForm& GetPendingPassword() const override;
+ bool IsPasswordOverridden() const override;
+ const std::vector<const autofill::PasswordForm*>& GetCurrentForms() const
+ override;
+ const std::vector<const autofill::PasswordForm*>& GetFederatedForms() const
+ override;
+ password_manager::InteractionsStats* GetCurrentInteractionStats() const
+ override;
+ void OnBubbleShown() override;
+ void OnBubbleHidden() override;
+ void OnNoInteractionOnUpdate() override;
+ void OnNopeUpdateClicked() override;
+ void NeverSavePassword() override;
+ void SavePassword() override;
+ void UpdatePassword(const autofill::PasswordForm& password_form) override;
+ void ChooseCredential(
+ const autofill::PasswordForm& form,
+ password_manager::CredentialType credential_type) override;
+ void NavigateToExternalPasswordManager() override;
+ void NavigateToSmartLockHelpPage() override;
+ void NavigateToPasswordManagerSettingsPage() override;
+ void NavigateToChromeSignIn() override;
+ void OnDialogHidden() override;
+
+ private:
+ PasswordsModelDelegate* delegate_;
+
+ DISALLOW_COPY_AND_ASSIGN(PasswordsModelDelegateProxy);
+};
+
+// Returns a proxy delegate instance for |contents|. The instance can be
+// destroyed by ManagePasswordsUIController.
+base::WeakPtr<PasswordsModelDelegateProxy>
+PasswordsModelDelegateProxyFromWebContents(content::WebContents* web_contents);
+
+#endif // CHROME_BROWSER_UI_PASSWORDS_PASSWORDS_MODEL_DELEGATE_PROXY_H_

Powered by Google App Engine
This is Rietveld 408576698