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

Unified Diff: chrome/browser/password_manager/password_manager_delegate_impl.cc

Issue 23140005: Added of new UMA signals in order to be able to discover early if the "save password" feature gets … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review 3 Created 7 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/password_manager/password_manager_delegate_impl.cc
diff --git a/chrome/browser/password_manager/password_manager_delegate_impl.cc b/chrome/browser/password_manager/password_manager_delegate_impl.cc
index 95ce6b81ab845a42af0b2c5712b4be28dbc1b363..e0b86f5be88cc261a2672e7bb6c3e1fee931d543 100644
--- a/chrome/browser/password_manager/password_manager_delegate_impl.cc
+++ b/chrome/browser/password_manager/password_manager_delegate_impl.cc
@@ -7,10 +7,12 @@
#include "base/memory/singleton.h"
#include "base/metrics/histogram.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/test/perftimer.h"
#include "chrome/browser/infobars/confirm_infobar_delegate.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/password_manager/password_form_manager.h"
#include "chrome/browser/password_manager/password_manager.h"
+#include "chrome/browser/password_manager/password_manager_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/sync/one_click_signin_helper.h"
#include "components/autofill/content/browser/autofill_driver_impl.h"
@@ -52,6 +54,8 @@ class SavePasswordInfoBarDelegate : public ConfirmInfoBarDelegate {
DONT_REMEMBER_PASSWORD,
NUM_RESPONSE_TYPES,
};
+ PerfTimer timer_;
vabr (Chromium) 2013/08/28 15:49:45 As Garrett pointed out, these variables should be
+ std::string domain_name_;
SavePasswordInfoBarDelegate(InfoBarService* infobar_service,
PasswordFormManager* form_to_save);
@@ -106,11 +110,23 @@ SavePasswordInfoBarDelegate::SavePasswordInfoBarDelegate(
: ConfirmInfoBarDelegate(infobar_service),
form_to_save_(form_to_save),
infobar_response_(NO_RESPONSE) {
+ password_manager_util::IsDomainNameMonitored(form_to_save->realm(),
+ &domain_name_);
+ if (domain_name_.size())
+ domain_name_.insert(0, "_");
+ UMA_HISTOGRAM_BOOLEAN("PasswordManager.InfobarDisplayed" + domain_name_,
+ true);
}
SavePasswordInfoBarDelegate::~SavePasswordInfoBarDelegate() {
+ // Time which allows us to consider that the info bar has been
+ // displayed during enough time for the user to make a decision.
+ const int kTime = 1000;
UMA_HISTOGRAM_ENUMERATION("PasswordManager.InfoBarResponse",
infobar_response_, NUM_RESPONSE_TYPES);
+ UMA_HISTOGRAM_BOOLEAN(
+ "PasswordManager.InfobarDisappearedQuickly" + domain_name_,
vabr (Chromium) 2013/08/28 15:49:45 I really liked Garrett's proposal to make this a U
+ timer_.Elapsed().InMilliseconds() < kTime);
}
int SavePasswordInfoBarDelegate::GetIconID() const {

Powered by Google App Engine
This is Rietveld 408576698