Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2462)

Unified Diff: chrome/browser/ui/views/profiles/profile_chooser_view.cc

Issue 227083007: UMA for New Profile Management. Track User-Menu Tutorial actions with Histograms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename constants; track tutorial card only once. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/profiles/profile_chooser_view.cc
diff --git a/chrome/browser/ui/views/profiles/profile_chooser_view.cc b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
index 5fc7301acb220e99466b0a7e81e5616eb344cfc4..f51e0d485dc764ef47c5a5c301602a90c21754df 100644
--- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc
+++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/profiles/profile_avatar_icon_util.h"
#include "chrome/browser/profiles/profile_info_cache.h"
#include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/browser/profiles/profile_metrics.h"
#include "chrome/browser/profiles/profile_window.h"
#include "chrome/browser/profiles/profiles_state.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
@@ -529,9 +530,16 @@ void ProfileChooserView::ButtonPressed(views::Button* sender,
// is indeed shown for the maximum number of times.
browser_->profile()->GetPrefs()->SetInteger(
prefs::kProfileAvatarTutorialShown, kProfileAvatarTutorialShowMax + 1);
+
+ ProfileMetrics::
+ LogProfileMirrorEnrollment(
noms (inactive) 2014/04/29 14:27:31 nit: move the LogProfile... to the previous line,
Mike Lerman 2014/04/29 20:28:02 Done.
+ ProfileMetrics::PROFILE_ENROLLMENT_CLOSE_WELCOME_CARD);
ShowView(BUBBLE_VIEW_MODE_PROFILE_CHOOSER, avatar_menu_.get());
} else if (sender == tutorial_enable_new_profile_management_button_) {
profiles::EnableNewProfileManagementPreview();
+ ProfileMetrics::
+ LogProfileMirrorEnrollment(
noms (inactive) 2014/04/29 14:27:31 move this above the EnableNew...() call. That meth
Mike Lerman 2014/04/29 20:28:02 Done.
Mike Lerman 2014/04/29 20:28:02 Done.
+ ProfileMetrics::PROFILE_ENROLLMENT_ACCEPT_MIRROR);
} else if (sender == remove_account_and_relaunch_button_) {
RemoveAccount();
} else if (sender == account_removal_cancel_button_) {
@@ -597,6 +605,9 @@ void ProfileChooserView::LinkClicked(views::Link* sender, int event_flags) {
} else {
DCHECK(sender == tutorial_learn_more_link_);
// TODO(guohui): update |learn_more_url| once it is decided.
+ ProfileMetrics::
noms (inactive) 2014/04/29 14:27:31 nit: move this above the //TODO, so that the comme
Mike Lerman 2014/04/29 20:28:02 Done.
+ LogProfileMirrorEnrollment(
+ ProfileMetrics::PROFILE_ENROLLMENT_LAUNCH_LEARN_MORE);
const GURL lear_more_url("https://support.google.com/chrome/?hl=en#to");
chrome::NavigateParams params(
browser_->profile(),
@@ -672,6 +683,13 @@ views::View* ProfileChooserView::CreateProfileChooserView(
}
if (tutorial_view) {
+ // Be sure not to track the tutorial display on View refresh, and only count
+ // the preview-promo view, not the welcome-enabled view.
+ if (tutorial_shown == false && !switches::IsNewProfileManagement()) {
+ ProfileMetrics::
+ LogProfileMirrorEnrollment(
+ ProfileMetrics::PROFILE_ENROLLMENT_SHOW_PREVIEW_PROMO);
+ }
layout->StartRow(1, 0);
layout->AddView(tutorial_view);
}
@@ -728,7 +746,6 @@ views::View* ProfileChooserView::CreatePreviewEnabledTutorialView(
profile->GetPrefs()->SetInteger(
prefs::kProfileAvatarTutorialShown, show_count + 1);
}
- tutorial_showing_ = true;
return CreateTutorialView(
l10n_util::GetStringUTF16(IDS_PROFILES_PREVIEW_ENABLED_TUTORIAL_TITLE),
@@ -747,6 +764,8 @@ views::View* ProfileChooserView::CreateTutorialView(
const base::string16& button_text,
views::Link** link,
views::LabelButton** button) {
+ tutorial_showing_ = true;
+
views::View* view = new views::View();
view->set_background(views::Background::CreateSolidBackground(
profiles::kAvatarTutorialBackgroundColor));
@@ -762,7 +781,7 @@ views::View* ProfileChooserView::CreateTutorialView(
title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
title_label->SetAutoColorReadabilityEnabled(false);
title_label->SetEnabledColor(SK_ColorWHITE);
- title_label ->SetFontList(ui::ResourceBundle::GetSharedInstance().GetFontList(
+ title_label->SetFontList(ui::ResourceBundle::GetSharedInstance().GetFontList(
ui::ResourceBundle::MediumFont));
layout->StartRow(1, 0);
layout->AddView(title_label);

Powered by Google App Engine
This is Rietveld 408576698