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 60173a9474a89c2c29823c484a8a957eab29fa9e..c722194b735eab194c96e60d41f18367ee03b61c 100644 |
--- a/chrome/browser/ui/passwords/manage_passwords_bubble_model.h |
+++ b/chrome/browser/ui/passwords/manage_passwords_bubble_model.h |
@@ -5,7 +5,9 @@ |
#ifndef CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ |
#define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ |
+#include "chrome/browser/ui/passwords/manage_passwords_bubble.h" |
#include "components/autofill/core/common/password_form.h" |
+#include "components/password_manager/core/browser/password_manager_metrics_util.h" |
#include "content/public/browser/web_contents_observer.h" |
class ManagePasswordsIconController; |
@@ -30,6 +32,12 @@ class ManagePasswordsBubbleModel : public content::WebContentsObserver { |
enum PasswordAction { REMOVE_PASSWORD, ADD_PASSWORD }; |
+ // Called by the view code when the bubble is shown. |
+ void OnBubbleShown(ManagePasswordsBubble::DisplayReason reason); |
+ |
+ // Called by the view code when the bubble is hidden. |
+ void OnBubbleHidden(); |
+ |
// Called by the view code when the "Nope" button in clicked by the user. |
void OnNopeClicked(); |
@@ -40,6 +48,9 @@ class ManagePasswordsBubbleModel : public content::WebContentsObserver { |
// Called by the view code when the save button in clicked by the user. |
void OnSaveClicked(); |
+ // Called by the view code when the "Done" button is clicked by the user. |
+ void OnDoneClicked(); |
+ |
// Called by the view code when the manage link is clicked by the user. |
void OnManageLinkClicked(); |
@@ -48,6 +59,9 @@ class ManagePasswordsBubbleModel : public content::WebContentsObserver { |
void OnPasswordAction(const autofill::PasswordForm& password_form, |
PasswordAction action); |
+ // Close the bubble without logging. |
vabr (Chromium)
2014/04/10 09:30:24
nit: This does not really say more than the functi
|
+ void OnCloseWithoutLogging(); |
+ |
// Called by the view code when the ManagePasswordItemView is destroyed and |
// the user chose to delete the password. |
// TODO(npentrel): Remove this once best_matches_ are newly made on bubble |
@@ -70,6 +84,25 @@ class ManagePasswordsBubbleModel : public content::WebContentsObserver { |
const autofill::PasswordFormMap& best_matches() { return best_matches_; } |
const base::string16& manage_link() { return manage_link_; } |
+ // Gets and sets the reason the bubble was displayed. |
+ password_manager::metrics_util::UIDisplayDisposition display_disposition() |
+ const { |
+ return display_disposition_; |
+ } |
+ void set_display_disposition( |
vabr (Chromium)
2014/04/10 09:30:24
I might be mistaken, but all these 4 accessors onl
Mike West
2014/04/10 09:53:46
They're also used in the tests I haven't finished
vabr (Chromium)
2014/04/10 10:24:44
But then please mark them as for testing only, and
|
+ password_manager::metrics_util::UIDisplayDisposition disposition) { |
+ display_disposition_ = disposition; |
+ } |
+ |
+ // Gets and sets the reason the bubble was dismissed. |
+ password_manager::metrics_util::UIDismissalReason dismissal_reason() const { |
+ return dismissal_reason_; |
+ } |
+ void set_dismissal_reason( |
+ password_manager::metrics_util::UIDismissalReason reason) { |
+ dismissal_reason_ = reason; |
+ } |
+ |
private: |
// content::WebContentsObserver |
virtual void WebContentsDestroyed( |
@@ -83,6 +116,9 @@ class ManagePasswordsBubbleModel : public content::WebContentsObserver { |
autofill::PasswordFormMap best_matches_; |
base::string16 manage_link_; |
+ password_manager::metrics_util::UIDisplayDisposition display_disposition_; |
+ password_manager::metrics_util::UIDismissalReason dismissal_reason_; |
+ |
DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleModel); |
}; |