Commit a6445941 authored by Alice Wang's avatar Alice Wang Committed by Commit Bot

[Android][WebSignin][Metric] Record StartedGuestSession for incognito

This CL adds and records the metric StartedGuestSession when user
opens incognito tab in the web sign-in flow.

Bug: 1127841
Change-Id: I58b01077089f6cbf949719ba699c06d65bb7cb77
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2418095
Commit-Queue: Alice Wang <aliceywang@chromium.org>
Reviewed-by: default avatarRohit Agarwal <roagarwal@chromium.org>
Reviewed-by: default avatarBoris Sazonov <bsazonov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#808425}
parent 65fd7a09
......@@ -12,6 +12,8 @@ import org.chromium.base.ThreadUtils;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.help.HelpAndFeedback;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.signin.account_picker.AccountConsistencyPromoAction;
import org.chromium.chrome.browser.signin.account_picker.AccountPickerDelegate;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tab.TabLaunchType;
import org.chromium.chrome.browser.tabmodel.TabCreator;
......@@ -63,8 +65,9 @@ public class IncognitoInterstitialDelegate {
*/
@MainThread
void openCurrentUrlInIncognitoTab() {
// TODO(https://crbug.com/1120334): Add metrics to web sign-in flow.
ThreadUtils.assertOnUiThread();
AccountPickerDelegate.recordAccountConsistencyPromoAction(
AccountConsistencyPromoAction.STARTED_INCOGNITO_SESSION);
Tab currentRegularTab = TabModelUtils.getCurrentTab(mRegularTabModel);
mIncognitoTabCreator.launchUrl(
currentRegularTab.getUrlString(), TabLaunchType.FROM_CHROME_UI);
......
......@@ -20,6 +20,7 @@ import java.lang.annotation.RetentionPolicy;
AccountConsistencyPromoAction.SUPPRESSED_NO_ACCOUNTS,
AccountConsistencyPromoAction.DISMISSED_BACK,
AccountConsistencyPromoAction.ADD_ACCOUNT,
AccountConsistencyPromoAction.STARTED_INCOGNITO_SESSION,
})
@Retention(RetentionPolicy.SOURCE)
public @interface AccountConsistencyPromoAction {
......@@ -38,5 +39,12 @@ public @interface AccountConsistencyPromoAction {
*/
int ADD_ACCOUNT = 2;
int MAX = 3;
/**
* User tapped the button from the expanded account list to open the incognito interstitial
* then confirmed opening the page in the incognito tab by tapping |Continue| in the incognito
* interstitial.
*/
int STARTED_INCOGNITO_SESSION = 3;
int MAX = 4;
}
......@@ -178,7 +178,6 @@ class AccountPickerBottomSheetView implements BottomSheetContent {
}
void setUpIncognitoInterstitialView() {
// TODO(crbug.com/1103262): Setup the incognito interstitial strings.
mLogoImage.setImageResource(R.drawable.location_bar_incognito_badge);
mAccountPickerTitle.setText(R.string.incognito_interstitial_title);
mIncognitoInterstitialView.setVisibility(View.VISIBLE);
......
......@@ -955,6 +955,11 @@ Unknown properties are collapsed to zero. -->
<int value="2" label="AddAccount">
User has tapped |Add account to device| from expanded account list.
</int>
<int value="3" label="StartedIncognitoSession">
User tapped the button from the expanded account list to open the incognito
interstitial then confirmed opening the page in the incognito tab by tapping
|Continue| in the incognito interstitial.
</int>
</enum>
<enum name="AccountManagerAccountAdditionSource">
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