Chromium Code Reviews| Index: chrome/browser/profiles/profile_manager.cc |
| diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc |
| index 716adf8e208510dba59be5adee534fec0da59a1c..10f2e0e0e5856cc9fec56749193915337466b52d 100644 |
| --- a/chrome/browser/profiles/profile_manager.cc |
| +++ b/chrome/browser/profiles/profile_manager.cc |
| @@ -38,6 +38,7 @@ |
| #include "chrome/browser/profiles/profile_destroyer.h" |
| #include "chrome/browser/profiles/profile_info_cache.h" |
| #include "chrome/browser/profiles/profile_metrics.h" |
| +#include "chrome/browser/profiles/profile_statistics.h" |
| #include "chrome/browser/profiles/profiles_state.h" |
| #include "chrome/browser/signin/account_fetcher_service_factory.h" |
| #include "chrome/browser/signin/account_reconcilor_factory.h" |
| @@ -1055,6 +1056,12 @@ void ProfileManager::DoFinalInit(Profile* profile, bool go_off_the_record) { |
| chrome::NOTIFICATION_PROFILE_ADDED, |
| content::Source<Profile>(profile), |
| content::NotificationService::NoDetails()); |
| + |
| + // Record statistics to ProfileInfoCache if not a normal shutdown. |
|
Mike Lerman
2015/11/26 15:06:25
rephrase to
Record statistics to ProfileInfoCache
lwchkg
2015/12/02 15:33:34
Yeah we need to make this comment clearer.
I've r
|
| + if (!profile->IsGuestSession() && !profile->IsSystemProfile() && |
| + !profile->IsNewProfile() && !go_off_the_record && |
| + profile->GetLastSessionExitType() != Profile::EXIT_NORMAL) |
|
Mike Lerman
2015/11/26 15:06:25
nit: use braces around the statement
lwchkg
2015/12/02 15:33:34
Yeah it looks better with the braces.
Just someth
Mike Lerman
2015/12/07 16:21:20
I'm not aware of a change, but that doesn't mean o
lwchkg
2015/12/09 03:39:41
I see. I can't read this message clearly with the
|
| + profiles::StoreProfileStatisticsToCache(profile); |
| } |
| void ProfileManager::DoFinalInitForServices(Profile* profile, |
| @@ -1461,6 +1468,9 @@ void ProfileManager::BrowserListObserver::OnBrowserRemoved( |
| return; |
| } |
| + // Store statistics into ProfileInfoCache. |
| + profiles::StoreProfileStatisticsToCache(profile); |
| + |
| // If the last browser of a profile that is scheduled for deletion is closed |
| // do that now. |
| base::FilePath path = profile->GetPath(); |