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..3d4233ec2a1c593df803ebcf8e39d4f0b31f8a2b 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" |
@@ -172,6 +171,7 @@ UserManagerScreenHandler::UserManagerScreenHandler() |
profileInfoCacheObserver_.reset( |
new UserManagerScreenHandler::ProfileUpdateObserver( |
g_browser_process->profile_manager(), this)); |
+ ProfileMetrics::LogProfileSwitchUser(ProfileMetrics::OPEN_PROFILE_MANAGER); |
noms (inactive)
2014/01/23 17:00:57
I'm not sure whether this should be in here, or in
bcwhite
2014/01/23 18:14:05
Gotcha. Moved to UserManagerView::Show() for now.
|
} |
UserManagerScreenHandler::~UserManagerScreenHandler() { |
@@ -187,6 +187,7 @@ void UserManagerScreenHandler::HandleInitialize(const base::ListValue* args) { |
void UserManagerScreenHandler::HandleAddUser(const base::ListValue* args) { |
profiles::CreateAndSwitchToNewProfile(desktop_type_, |
base::Bind(&chrome::HideUserManager)); |
+ ProfileMetrics::LogProfileAddNewUser(ProfileMetrics::ADD_NEW_USER_MANAGER); |
} |
void UserManagerScreenHandler::HandleAuthenticatedLaunchUser( |
@@ -234,7 +235,7 @@ void UserManagerScreenHandler::HandleAuthenticatedLaunchUser( |
return; |
} |
- ReportAuthenticationResult(true); |
+ ReportAuthenticationResult(true, ProfileMetrics::AUTH_LOCAL); |
} |
void UserManagerScreenHandler::HandleRemoveUser(const base::ListValue* args) { |
@@ -258,11 +259,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 +295,24 @@ 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)); |
+ ProfileMetrics::LogProfileSwitchUser(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); |
} |
void UserManagerScreenHandler::RegisterMessages() { |
@@ -441,8 +446,10 @@ 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); |
ProfileInfoCache& info_cache = |
g_browser_process->profile_manager()->GetProfileInfoCache(); |
info_cache.SetProfileSigninRequiredAtIndex( |
@@ -451,7 +458,9 @@ void UserManagerScreenHandler::ReportAuthenticationResult(bool success) { |
authenticating_profile_index_); |
profiles::SwitchToProfile(path, desktop_type_, true, |
base::Bind(&chrome::HideUserManager)); |
+ ProfileMetrics::LogProfileSwitchUser(ProfileMetrics::SWITCH_PROFILE_UNLOCK); |
} else { |
+ ProfileMetrics::LogProfileAuthResult(ProfileMetrics::AUTH_FAILED); |
web_ui()->CallJavascriptFunction( |
"cr.ui.Oobe.showSignInError", |
base::FundamentalValue(0), |