Chromium Code Reviews| 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..65fa15c9fee3fecef18e196c8751d93da46f49b1 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" |
| @@ -74,6 +76,13 @@ class SavePasswordInfoBarDelegate : public ConfirmInfoBarDelegate { |
| // Used to track the results we get from the info bar. |
| ResponseType infobar_response_; |
| + // Save password prompt lifetime needed for a UMA signal. |
| + PerfTimer timer_; |
| + |
| + // The domain name of the current webpage. This variable is used for UMA |
| + // signals. |
|
Ilya Sherman
2013/08/29 06:42:21
This comment doesn't fully reflect the use of the
jdomingos
2013/08/30 21:09:20
Done.
|
| + std::string domain_name_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(SavePasswordInfoBarDelegate); |
| }; |
| @@ -106,11 +115,22 @@ 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); |
|
Ilya Sherman
2013/08/29 06:42:21
This will not work, for the reasons that the other
Ilya Sherman
2013/08/29 06:42:21
This is a little strange, because it causes the me
jdomingos
2013/08/30 21:09:20
Hi Ilya,
Indeed regarding the PasswordManager.Inf
jdomingos
2013/08/30 21:09:20
Done.
|
| } |
| 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. |
|
Ilya Sherman
2013/08/29 06:42:21
I don't understand what this comment means. Could
jdomingos
2013/08/30 21:09:20
The comment here was for a previous variable which
|
| UMA_HISTOGRAM_ENUMERATION("PasswordManager.InfoBarResponse", |
| infobar_response_, NUM_RESPONSE_TYPES); |
| + UMA_HISTOGRAM_TIMES( |
| + "PasswordManager.InfobarLifetime" + domain_name_, |
|
Ilya Sherman
2013/08/29 06:42:21
As above, you'll need to inline the macro, because
Ilya Sherman
2013/08/29 06:42:21
As above, it's strange that the un-suffixed Passwo
jdomingos
2013/08/30 21:09:20
You are right, as above this is not the expected b
jdomingos
2013/08/30 21:09:20
Done.
|
| + timer_.Elapsed()); |
| } |
| int SavePasswordInfoBarDelegate::GetIconID() const { |