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

Unified Diff: chrome/browser/ui/passwords/manage_passwords_bubble_model.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_bubble_model.h
diff --git a/chrome/browser/ui/passwords/manage_passwords_bubble_model.h b/chrome/browser/ui/passwords/manage_passwords_bubble_model.h
index 2b01a57bad5df1acde14ed157fd853e8ecb69a82..0fcc2c9df75fa18fe6d9e803b468f1122f435dda 100644
--- a/chrome/browser/ui/passwords/manage_passwords_bubble_model.h
+++ b/chrome/browser/ui/passwords/manage_passwords_bubble_model.h
@@ -9,34 +9,34 @@
#include "base/macros.h"
#include "base/memory/scoped_vector.h"
+#include "base/memory/weak_ptr.h"
#include "base/time/clock.h"
#include "components/autofill/core/common/password_form.h"
#include "components/password_manager/core/browser/password_manager_metrics_util.h"
#include "components/password_manager/core/browser/statistics_table.h"
#include "components/password_manager/core/common/password_manager_ui.h"
-#include "content/public/browser/web_contents_observer.h"
#include "ui/gfx/range/range.h"
-class Profile;
-
namespace content {
class WebContents;
}
+class PasswordsModelDelegate;
+class Profile;
+
// This model provides data for the ManagePasswordsBubble and controls the
// password management actions.
-class ManagePasswordsBubbleModel : public content::WebContentsObserver {
+class ManagePasswordsBubbleModel {
public:
enum PasswordAction { REMOVE_PASSWORD, ADD_PASSWORD };
enum DisplayReason { AUTOMATIC, USER_ACTION };
- // Creates a ManagePasswordsBubbleModel, which holds a raw pointer to the
- // WebContents in which it lives. Construction implies that the bubble
- // is shown. The bubble's state is updated from the
- // ManagePasswordsUIController associated with |web_contents|.
- ManagePasswordsBubbleModel(content::WebContents* web_contents,
+ // Creates a ManagePasswordsBubbleModel, which holds a weak pointer to the
+ // delegate. Construction implies that the bubble is shown. The bubble's state
+ // is updated from the ManagePasswordsUIController associated with |delegate|.
+ ManagePasswordsBubbleModel(base::WeakPtr<PasswordsModelDelegate> delegate,
DisplayReason reason);
- ~ManagePasswordsBubbleModel() override;
+ ~ManagePasswordsBubbleModel();
// Called by the view code when the "Nope" button in clicked by the user in
// update bubble.
@@ -104,6 +104,7 @@ class ManagePasswordsBubbleModel : public content::WebContentsObserver {
}
Profile* GetProfile() const;
+ content::WebContents* GetWebContents() const;
// Returns true iff the multiple account selection prompt for account update
// should be presented.
@@ -151,6 +152,9 @@ class ManagePasswordsBubbleModel : public content::WebContentsObserver {
// Responsible for recording all the interactions required.
std::unique_ptr<InteractionKeeper> interaction_keeper_;
+ // A bridge to ManagePasswordsUIController instance.
+ base::WeakPtr<PasswordsModelDelegate> delegate_;
+
DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleModel);
};

Powered by Google App Engine
This is Rietveld 408576698