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

Unified Diff: chrome/browser/ui/webui/signin/user_manager_screen_handler.cc

Issue 132453004: Add Profile metric counting to new User Manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added new metric information to xml file Created 6 years, 11 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/webui/signin/user_manager_screen_handler.cc
diff --git a/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc b/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc
index 0255e5e6cd221cea47318f4d5de08f8a1c65d7ff..8af6a1b56d6aabe5522f10efe9f7bf34e14d7774 100644
--- a/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc
+++ b/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc
@@ -8,7 +8,6 @@
#include "base/value_conversions.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
-#include "chrome/browser/profiles/avatar_menu.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_info_cache.h"
#include "chrome/browser/profiles/profile_info_cache_observer.h"
@@ -186,7 +185,8 @@ void UserManagerScreenHandler::HandleInitialize(const base::ListValue* args) {
void UserManagerScreenHandler::HandleAddUser(const base::ListValue* args) {
profiles::CreateAndSwitchToNewProfile(desktop_type_,
- base::Bind(&chrome::HideUserManager));
+ base::Bind(&chrome::HideUserManager),
+ ProfileMetrics::ADD_NEW_USER_MANAGER);
}
void UserManagerScreenHandler::HandleAuthenticatedLaunchUser(
@@ -234,7 +234,7 @@ void UserManagerScreenHandler::HandleAuthenticatedLaunchUser(
return;
}
- ReportAuthenticationResult(true);
+ ReportAuthenticationResult(true, ProfileMetrics::AUTH_LOCAL);
}
void UserManagerScreenHandler::HandleRemoveUser(const base::ListValue* args) {
@@ -258,11 +258,13 @@ void UserManagerScreenHandler::HandleRemoveUser(const base::ListValue* args) {
g_browser_process->profile_manager()->ScheduleProfileForDeletion(
profile_path,
base::Bind(&OpenNewWindowForProfile, desktop_type_));
+ ProfileMetrics::LogProfileDeleteUser(ProfileMetrics::PROFILE_DELETED);
}
void UserManagerScreenHandler::HandleLaunchGuest(const base::ListValue* args) {
profiles::SwitchToGuestProfile(desktop_type_,
base::Bind(&chrome::HideUserManager));
+ ProfileMetrics::LogProfileSwitchUser(ProfileMetrics::SWITCH_PROFILE_GUEST);
}
void UserManagerScreenHandler::HandleLaunchUser(const base::ListValue* args) {
@@ -292,22 +294,26 @@ void UserManagerScreenHandler::HandleLaunchUser(const base::ListValue* args) {
// not needing authentication. If it is, just ignore the "launch" request.
if (info_cache.ProfileIsSigninRequiredAtIndex(profile_index))
return;
+ ProfileMetrics::LogProfileAuthResult(ProfileMetrics::AUTH_UNNECESSARY);
base::FilePath path = info_cache.GetPathOfProfileAtIndex(profile_index);
- profiles::SwitchToProfile(
- path, desktop_type_, true, base::Bind(&chrome::HideUserManager));
+ profiles::SwitchToProfile(path,
+ desktop_type_,
msw 2014/01/29 17:51:58 optional nit: you could wrap some of these args.
+ true,
+ base::Bind(&chrome::HideUserManager),
+ ProfileMetrics::SWITCH_PROFILE_MANAGER);
}
void UserManagerScreenHandler::OnClientLoginSuccess(
const ClientLoginResult& result) {
chrome::SetLocalAuthCredentials(authenticating_profile_index_,
password_attempt_);
- ReportAuthenticationResult(true);
+ ReportAuthenticationResult(true, ProfileMetrics::AUTH_ONLINE);
}
void UserManagerScreenHandler::OnClientLoginFailure(
const GoogleServiceAuthError& error) {
- ReportAuthenticationResult(false);
+ ReportAuthenticationResult(false, ProfileMetrics::AUTH_ONLINE);
msw 2014/01/29 17:51:58 Shouldn't this be AUTH_FAILED?
bcwhite 2014/01/29 19:50:52 It could be, yes. Done.
}
void UserManagerScreenHandler::RegisterMessages() {
@@ -441,8 +447,11 @@ void UserManagerScreenHandler::SendUserList() {
users_list, base::FundamentalValue(false), base::FundamentalValue(true));
}
-void UserManagerScreenHandler::ReportAuthenticationResult(bool success) {
+void UserManagerScreenHandler::ReportAuthenticationResult(
+ bool success,
+ ProfileMetrics::ProfileAuth auth) {
if (success) {
+ ProfileMetrics::LogProfileAuthResult(auth);
msw 2014/01/29 17:51:58 If you correct the above AUTH_ONLINE to AUTH_FAILE
bcwhite 2014/01/29 19:50:52 Done.
ProfileInfoCache& info_cache =
g_browser_process->profile_manager()->GetProfileInfoCache();
info_cache.SetProfileSigninRequiredAtIndex(
@@ -450,8 +459,10 @@ void UserManagerScreenHandler::ReportAuthenticationResult(bool success) {
base::FilePath path = info_cache.GetPathOfProfileAtIndex(
authenticating_profile_index_);
profiles::SwitchToProfile(path, desktop_type_, true,
- base::Bind(&chrome::HideUserManager));
+ base::Bind(&chrome::HideUserManager),
+ ProfileMetrics::SWITCH_PROFILE_UNLOCK);
} else {
+ ProfileMetrics::LogProfileAuthResult(ProfileMetrics::AUTH_FAILED);
web_ui()->CallJavascriptFunction(
"cr.ui.Oobe.showSignInError",
base::FundamentalValue(0),

Powered by Google App Engine
This is Rietveld 408576698