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

Unified Diff: chrome/browser/ui/browser.cc

Issue 1428973003: Utilize ProfileInfoCache to support data type counts in profile deletion flow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: user_pod_row.js done, statistics now saved when the last window of a profile is closed. Created 5 years, 1 month 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/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 3b134e72b6f2d12a2fb3ce4af06dda0da61ac1bd..a73d1572f84a2660de711c434ab940d7cae37a62 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -68,6 +68,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_destroyer.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/repost_form_warning_controller.h"
#include "chrome/browser/search/search.h"
@@ -514,8 +515,8 @@ Browser::~Browser() {
if (tab_restore_service)
tab_restore_service->BrowserClosed(live_tab_context());
-#if !defined(OS_MACOSX)
if (!chrome::GetTotalBrowserCountForProfile(profile_)) {
+#if !defined(OS_MACOSX)
// We're the last browser window with this profile. We need to nuke the
// TabRestoreService, which will start the shutdown of the
// NavigationControllers and allow for proper shutdown. If we don't do this
@@ -526,9 +527,12 @@ Browser::~Browser() {
// the last browser has closed. The Mac equivalent is in its app
// controller.
TabRestoreServiceFactory::ResetForProfile(profile_);
- }
#endif
+ // Store statistics into ProfileInfoCache
Mike Lerman 2015/11/03 20:50:42 nit: amend a period. Although this comment isn't n
lwchkg 2015/11/04 00:11:07 Acknowledged.
+ profiles::StoreProfileStatisticsToCache(profile_);
Mike Lerman 2015/11/03 20:50:42 There's a better place for this hook. Put this in
lwchkg 2015/11/04 00:11:07 Sounds good! Will check tonight.
+ }
+
profile_pref_registrar_.RemoveAll();
encoding_auto_detect_.Destroy();

Powered by Google App Engine
This is Rietveld 408576698