Commit e06b4e6a authored by tedchoc@chromium.org's avatar tedchoc@chromium.org

Fix Android not tracking all AutoLogin metrics.

Android's delegate overrides Accept/Cancel and does not record
all the necessary histogram actions.

BUG=329200

Review URL: https://codereview.chromium.org/258093003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266772 0039d316-1c4b-4281-b951-d872f2087c98
parent 186b2a3c
......@@ -68,6 +68,7 @@ bool AutoLoginInfoBarDelegateAndroid::Accept() {
reinterpret_cast<intptr_t>(this));
// Do not close the infobar on accept, it will be closed as part
// of the log in callback.
RecordHistogramAction(ACCEPTED);
return false;
}
......@@ -78,6 +79,7 @@ bool AutoLoginInfoBarDelegateAndroid::Cancel() {
DCHECK(delegate.obj());
Java_AutoLoginDelegate_cancelLogIn(env, delegate.obj(),
reinterpret_cast<intptr_t>(this));
RecordHistogramAction(REJECTED);
return true;
}
......
......@@ -179,6 +179,11 @@ AutoLoginInfoBarDelegate::~AutoLoginInfoBarDelegate() {
RecordHistogramAction(IGNORED);
}
void AutoLoginInfoBarDelegate::RecordHistogramAction(Actions action) {
UMA_HISTOGRAM_ENUMERATION("AutoLogin.Regular", action,
HISTOGRAM_BOUNDING_VALUE);
}
void AutoLoginInfoBarDelegate::InfoBarDismissed() {
RecordHistogramAction(DISMISSED);
button_pressed_ = true;
......@@ -233,8 +238,3 @@ bool AutoLoginInfoBarDelegate::Cancel() {
void AutoLoginInfoBarDelegate::GoogleSignedOut(const std::string& username) {
infobar()->RemoveSelf();
}
void AutoLoginInfoBarDelegate::RecordHistogramAction(Actions action) {
UMA_HISTOGRAM_ENUMERATION("AutoLogin.Regular", action,
HISTOGRAM_BOUNDING_VALUE);
}
......@@ -38,10 +38,6 @@ class AutoLoginInfoBarDelegate : public ConfirmInfoBarDelegate,
static bool Create(content::WebContents* web_contents, const Params& params);
protected:
AutoLoginInfoBarDelegate(const Params& params, Profile* profile);
virtual ~AutoLoginInfoBarDelegate();
private:
// Enum values used for UMA histograms.
enum Actions {
SHOWN, // The infobar was shown to the user.
......@@ -53,6 +49,12 @@ class AutoLoginInfoBarDelegate : public ConfirmInfoBarDelegate,
HISTOGRAM_BOUNDING_VALUE
};
AutoLoginInfoBarDelegate(const Params& params, Profile* profile);
virtual ~AutoLoginInfoBarDelegate();
void RecordHistogramAction(Actions action);
private:
// ConfirmInfoBarDelegate:
virtual void InfoBarDismissed() OVERRIDE;
virtual int GetIconID() const OVERRIDE;
......@@ -66,8 +68,6 @@ class AutoLoginInfoBarDelegate : public ConfirmInfoBarDelegate,
// SigninManagerBase::Observer:
virtual void GoogleSignedOut(const std::string& username) OVERRIDE;
void RecordHistogramAction(Actions action);
const Params params_;
Profile* profile_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment