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, |