| Index: chrome/browser/ui/webui/options/manage_profile_handler.cc
|
| ===================================================================
|
| --- chrome/browser/ui/webui/options/manage_profile_handler.cc (revision 112673)
|
| +++ chrome/browser/ui/webui/options/manage_profile_handler.cc (working copy)
|
| @@ -174,11 +174,27 @@
|
| if (!args->GetString(2, &icon_url))
|
| return;
|
|
|
| + // Metrics logging variable.
|
| + bool previously_using_gaia_icon =
|
| + cache.IsUsingGAIANameOfProfileAtIndex(profile_index);
|
| +
|
| size_t new_icon_index;
|
| if (icon_url == gaia_picture_url_) {
|
| cache.SetIsUsingGAIAPictureOfProfileAtIndex(profile_index, true);
|
| + if (!previously_using_gaia_icon) {
|
| + // Only log if they changed to the GAIA photo.
|
| + ProfileMetrics::LogProfileAvatarSelection(ProfileMetrics::AVATAR_GAIA);
|
| + ProfileMetrics::LogProfileSwitchGaia(ProfileMetrics::GAIA_OPT_IN);
|
| + }
|
| } else if (cache.IsDefaultAvatarIconUrl(icon_url, &new_icon_index)) {
|
| - ProfileMetrics::LogProfileAvatarSelection(new_icon_index);
|
| + size_t previous_icon_index =
|
| + cache.GetAvatarIconIndexOfProfileAtIndex(profile_index);
|
| + if (previous_icon_index != new_icon_index) {
|
| + ProfileMetrics::LogProfileAvatarSelection(new_icon_index);
|
| + }
|
| + if (previously_using_gaia_icon) {
|
| + ProfileMetrics::LogProfileSwitchGaia(ProfileMetrics::GAIA_OPT_OUT);
|
| + }
|
| cache.SetAvatarIconOfProfileAtIndex(profile_index, new_icon_index);
|
| cache.SetIsUsingGAIAPictureOfProfileAtIndex(profile_index, false);
|
| }
|
|
|