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

Unified Diff: chrome/browser/profiles/profile_window.cc

Issue 844193005: Add UMA metrics for profile switching. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/profiles/profile_window.cc
diff --git a/chrome/browser/profiles/profile_window.cc b/chrome/browser/profiles/profile_window.cc
index 320388f389c31804652867d0be3d406c68773c11..faf37966ad5fd477fc5c3ea1ec791565835799b1 100644
--- a/chrome/browser/profiles/profile_window.cc
+++ b/chrome/browser/profiles/profile_window.cc
@@ -270,6 +270,9 @@ void SwitchToProfile(const base::FilePath& path,
bool always_create,
ProfileManager::CreateCallback callback,
ProfileMetrics::ProfileOpen metric) {
+ bool already_opened =
+ g_browser_process->profile_manager()->GetProfileByPath(path) != NULL;
Mike Lerman 2015/01/21 20:58:03 Once a profile has been opened by the ProfileManag
anthonyvd 2015/01/23 16:01:31 Done.
+ ProfileMetrics::LogProfileSwitch(metric, already_opened);
g_browser_process->profile_manager()->CreateProfileAsync(
path,
base::Bind(&OpenBrowserWindowForProfile,
@@ -280,13 +283,18 @@ void SwitchToProfile(const base::FilePath& path,
base::string16(),
base::string16(),
std::string());
- ProfileMetrics::LogProfileSwitchUser(metric);
}
void SwitchToGuestProfile(chrome::HostDesktopType desktop_type,
ProfileManager::CreateCallback callback) {
+ base::FilePath path = ProfileManager::GetGuestProfilePath();
Mike Lerman 2015/01/21 20:58:03 const base::FilePath&
anthonyvd 2015/01/23 16:01:31 Done.
+ bool already_opened =
+ g_browser_process->profile_manager()->GetProfileByPath(path) != NULL;
Mike Lerman 2015/01/21 20:58:03 (Same as above)
anthonyvd 2015/01/23 16:01:31 Done.
+
+ ProfileMetrics::LogProfileSwitch(ProfileMetrics::SWITCH_PROFILE_GUEST,
+ already_opened);
g_browser_process->profile_manager()->CreateProfileAsync(
- ProfileManager::GetGuestProfilePath(),
+ path,
base::Bind(&OpenBrowserWindowForProfile,
callback,
false,
@@ -295,7 +303,6 @@ void SwitchToGuestProfile(chrome::HostDesktopType desktop_type,
base::string16(),
base::string16(),
std::string());
- ProfileMetrics::LogProfileSwitchUser(ProfileMetrics::SWITCH_PROFILE_GUEST);
}
void CreateAndSwitchToNewProfile(chrome::HostDesktopType desktop_type,

Powered by Google App Engine
This is Rietveld 408576698