Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/signin/AccountManagementScreenHelper.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountManagementScreenHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountManagementScreenHelper.java |
| index 044cc22d05c47e0ef70a0a7b4fc866c5af3ee1e9..f5b8e919d81608d23b1a69ef0d6fadf8a22f5401 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountManagementScreenHelper.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountManagementScreenHelper.java |
| @@ -24,8 +24,11 @@ public class AccountManagementScreenHelper { |
| * Opens the account management UI screen. |
| * @param applicationContext The application context. |
| * @param profile The user profile. |
| + * @param gaiaServiceType A signin::GAIAServiceType value that triggered the dialog. |
| */ |
| - void openAccountManagementScreen(Context applicationContext, Profile profile); |
| + void openAccountManagementScreen( |
| + Context applicationContext, Profile profile, |
| + int gaiaServiceType); |
|
David Trainor- moved to gerrit
2014/06/03 00:54:28
line above?
aruslan
2014/06/03 01:05:25
Done.
|
| } |
| /** |
| @@ -38,10 +41,46 @@ public class AccountManagementScreenHelper { |
| } |
| @CalledByNative |
| - private static void openAccountManagementScreen(Context applicationContext, Profile profile) { |
| + private static void openAccountManagementScreen( |
| + Context applicationContext, Profile profile, |
| + int gaiaServiceType) { |
|
David Trainor- moved to gerrit
2014/06/03 00:54:28
line above?
aruslan
2014/06/03 01:05:25
Done.
|
| ThreadUtils.assertOnUiThread(); |
| if (sManager == null) return; |
| - sManager.openAccountManagementScreen(applicationContext, profile); |
| + sManager.openAccountManagementScreen(applicationContext, profile, gaiaServiceType); |
| } |
| + |
| + /* |
| + * Enum for tracking user interactions with the account management menu |
|
David Trainor- moved to gerrit
2014/06/03 00:54:28
Add todo to generate from native?
aruslan
2014/06/03 01:05:25
Done.
|
| + * on Android. |
| + * This must match enum ProfileAndroidAccountManagementMenu in profile_metrics.h. |
| + */ |
| + // User arrived to the Account management screen. |
| + public static final int ACCOUNT_MANAGEMENT_MENU_VIEW = 0; |
|
David Trainor- moved to gerrit
2014/06/03 00:54:28
should these be up top?
aruslan
2014/06/03 01:05:25
Done.
|
| + // User arrived to the Account management screen, and clicked Add account. |
| + public static final int ACCOUNT_MANAGEMENT_MENU_ADD_ACCOUNT = 1; |
| + // User arrived to the Account management screen, and clicked Go incognito. |
| + public static final int ACCOUNT_MANAGEMENT_MENU_GO_INCOGNITO = 2; |
| + // User arrived to the Account management screen, and clicked on primary. |
| + public static final int ACCOUNT_MANAGEMENT_MENU_CLICK_PRIMARY_ACCOUNT = 3; |
| + // User arrived to the Account management screen, and clicked on secondary. |
| + public static final int ACCOUNT_MANAGEMENT_MENU_CLICK_SECONDARY_ACCOUNT = 4; |
| + // User arrived to the Account management screen, toggled Chrome signout. |
| + public static final int ACCOUNT_MANAGEMENT_MENU_TOGGLE_SIGNOUT = 5; |
| + // User toggled Chrome signout, and clicks Signout. |
| + public static final int ACCOUNT_MANAGEMENT_MENU_SIGNOUT_SIGNOUT = 6; |
| + // User toggled Chrome signout, and clicks Cancel. |
| + public static final int ACCOUNT_MANAGEMENT_MENU_SIGNOUT_CANCEL = 7; |
| + |
| + /** |
| + * Log a UMA event for a given metric and a signin type. |
| + * @param metric A PROFILE_ANDROID_ACCOUNT_MANAGEMENT_MENU metric. |
| + * @param gaiaServiceType A signin::GAIAServiceType. |
| + */ |
| + public static void logEvent(int metric, int gaiaServiceType) { |
| + nativeLogEvent(metric, gaiaServiceType); |
| + } |
| + |
| + // Native methods. |
| + private static native void nativeLogEvent(int metric, int gaiaServiceType); |
| } |