From 12bb682a916f1fde517fbee8fc7cdcf7cdede878 Mon Sep 17 00:00:00 2001 From: "dpranke@chromium.org" Date: Wed, 16 Jun 2010 02:00:46 +0000 Subject: Add a histogram tracking the responses to the "remember password" infobar. BUG=45946 R=jar@chromium.org, jcivelli@chromium.org TEST=none Review URL: http://codereview.chromium.org/2729022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49885 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/tab_contents/tab_contents.cc | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'chrome') diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index e398ded..78b2124 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -3099,15 +3099,18 @@ void TabContents::SetAppIcon(const SkBitmap& app_icon) { class SavePasswordInfoBarDelegate : public ConfirmInfoBarDelegate { public: SavePasswordInfoBarDelegate(TabContents* tab_contents, - PasswordFormManager* form_to_save) : - ConfirmInfoBarDelegate(tab_contents), - form_to_save_(form_to_save) { + PasswordFormManager* form_to_save) + : ConfirmInfoBarDelegate(tab_contents), + form_to_save_(form_to_save), + infobar_response_(kNoResponse) { } virtual ~SavePasswordInfoBarDelegate() { } // Overridden from ConfirmInfoBarDelegate: virtual void InfoBarClosed() { + UMA_HISTOGRAM_ENUMERATION("PasswordManager.InfoBarResponse", + infobar_response_, kNumResponseTypes); delete this; } @@ -3136,12 +3139,14 @@ class SavePasswordInfoBarDelegate : public ConfirmInfoBarDelegate { virtual bool Accept() { DCHECK(form_to_save_.get()); form_to_save_->Save(); + infobar_response_ = kRememberPassword; return true; } virtual bool Cancel() { DCHECK(form_to_save_.get()); form_to_save_->PermanentlyBlacklist(); + infobar_response_ = kDontRememberPassword; return true; } @@ -3150,6 +3155,15 @@ class SavePasswordInfoBarDelegate : public ConfirmInfoBarDelegate { // and should update as per her decision. scoped_ptr form_to_save_; + // Used to track the results we get from the info bar. + enum ResponseType { + kNoResponse = 0, + kRememberPassword, + kDontRememberPassword, + kNumResponseTypes, + }; + ResponseType infobar_response_; + DISALLOW_COPY_AND_ASSIGN(SavePasswordInfoBarDelegate); }; -- cgit v1.1