Commit 37fa0e51 authored by guohui's avatar guohui Committed by Commit bot

Upstream changes for android signin promo

1. add uma metrics related to the new android signin promo
2. add a method to SigninManager to get the finch experiment for promo

Downstream changes at https://chrome-internal-review.googlesource.com/#/c/175857/

BUG=406614
TBR=rogerta@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#294682}
parent ce80b519
......@@ -16,6 +16,7 @@ import android.util.Log;
import org.chromium.base.ActivityState;
import org.chromium.base.ApplicationStatus;
import org.chromium.base.CalledByNative;
import org.chromium.base.FieldTrialList;
import org.chromium.base.ObserverList;
import org.chromium.base.ThreadUtils;
import org.chromium.chrome.R;
......@@ -400,6 +401,22 @@ public class SigninManager {
return nativeIsNewProfileManagementEnabled();
}
/**
* @return Experiment group for the android signin promo that the current user falls into.
* -1 if the sigin promo experiment is disabled, otherwise an integer between 0 and 7.
* TODO(guohui): instead of group names, it is better to use experiment params to control
* the variations.
*/
public static int getAndroidSigninPromoExperimentGroup() {
String fieldTrialValue =
FieldTrialList.findFullName("AndroidSigninPromo");
try {
return Integer.parseInt(fieldTrialValue);
} catch (NumberFormatException ex) {
return -1;
}
}
@CalledByNative
private void onSigninAllowedByPolicyChanged(boolean newSigninAllowedByPolicy) {
mSigninAllowedByPolicy = newSigninAllowedByPolicy;
......
......@@ -43,6 +43,26 @@ enum Source {
SOURCE_UNKNOWN, // This must be last.
};
// Enum values used for Android signin promo actions.
enum AndroidSigninPromoAction {
// The promo was enabled.
HISTOGRAM_ANDROID_SIGNIN_PROMO_ENABLED = 0,
// The promo was shown.
HISTOGRAM_ANDROID_SIGNIN_PROMO_SHOWN,
// The promo was declined.
HISTOGRAM_ANDROID_SIGNIN_PROMO_DECLINED,
// The promo was accepted.
HISTOGRAM_ANDROID_SIGNIN_PROMO_ACCEPTED,
// The promo was accepted and user clicked the settings link.
HISTOGRAM_ANDROID_SIGNIN_PROMO_ACCEPTED_WITH_ADVANCED,
HISTOGRAM_ANDROID_SIGNIN_PROMO_MAX,
};
// Returns true if the sign in promo should be visible.
// |profile| is the profile of the tab the promo would be shown on.
bool ShouldShowPromo(Profile* profile);
......
......@@ -29372,6 +29372,11 @@ Therefore, the affected-histogram name has to have at least one dot in it.
</summary>
</histogram>
<histogram name="Signin.AndroidSigninPromo" enum="AndroidSigninPromoAction">
<owner>guohui@chromium.org</owner>
<summary>Track how a user interfacts with the android signin promo.</summary>
</histogram>
<histogram name="Signin.DuringFirstRun">
<owner>mlerman@chromium.org</owner>
<summary>
......@@ -37718,6 +37723,23 @@ Therefore, the affected-histogram name has to have at least one dot in it.
<int value="3" label="LowMemory"/>
</enum>
<enum name="AndroidSigninPromoAction" type="int">
<int value="0" label="Promo enabled">
The Android signin promo was enabled to show on next startup.
</int>
<int value="1" label="Promo shown">The Android signin promo was shown.</int>
<int value="2" label="Promo declined">
User declined the Android signin promo.
</int>
<int value="3" label="Promo accepted">
User completed signin through the Android signin promo flow successfully.
</int>
<int value="4" label="Promo accepted with advanced settings">
User completed signin through the Android signin promo flow successfully and
chose to configure sync settings.
</int>
</enum>
<enum name="AndroidTabCloseUndoToastEvent" type="int">
<int value="0" label="Undo Shown (Cold)"/>
<int value="1" label="Undo Shown (Warm)"/>
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