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

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

Issue 1087933002: Cross Device Promo - Main Eligibility Flow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pre-review Created 5 years, 7 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_manager.cc
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index e8771db996830e14e3f794af7adc9c9872afe918..ec631dc3b3c51e8816978705eed8eefd1d5fd8e6 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -39,6 +39,8 @@
#include "chrome/browser/profiles/startup_task_runner_service_factory.h"
#include "chrome/browser/signin/account_reconcilor_factory.h"
#include "chrome/browser/signin/account_tracker_service_factory.h"
+#include "chrome/browser/signin/cross_device_promo.h"
+#include "chrome/browser/signin/cross_device_promo_factory.h"
#include "chrome/browser/signin/gaia_cookie_manager_service_factory.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/sync/profile_sync_service.h"
@@ -1246,12 +1248,13 @@ void ProfileManager::FinishDeletingProfile(
// that the user's data would be removed, do so immediately.
profiles::RemoveBrowsingDataForProfile(profile_dir);
} else {
+ // It is safe to delete a not yet loaded Profile from disk.
BrowserThread::PostTask(
BrowserThread::FILE, FROM_HERE,
base::Bind(&NukeProfileFromDisk, profile_dir));
}
- // Queue even a profile that was Nuked so it will be MarkedForDeletion and so
+ // Queue even a profile that was nuked so it will be MarkedForDeletion and so
// CreateProfileAsync can't create it.
QueueProfileDirectoryForDeletion(profile_dir);
cache.DeleteProfileFromCache(profile_dir);
@@ -1376,8 +1379,17 @@ void ProfileManager::UpdateLastUser(Profile* last_active) {
ProfileInfoCache& cache = GetProfileInfoCache();
size_t profile_index =
cache.GetIndexOfProfileWithPath(last_active->GetPath());
- if (profile_index != std::string::npos)
+ if (profile_index != std::string::npos) {
+#if !defined(OS_CHROMEOS)
+ // Incognito Profiles don't have ProfileKeyedServices.
+ if (!last_active->IsOffTheRecord()) {
+ CrossDevicePromoFactory::GetForProfile(last_active)->
anthonyvd 2015/05/14 18:24:20 Random thought but would there be a way to do that
Mike Lerman 2015/05/14 20:25:33 Hmmm I almost could. The CrossDevicePromo could be
+ UpdateLastActiveTime(cache.GetProfileActiveTimeAtIndex(
+ profile_index));
+ }
+#endif
cache.SetProfileActiveTimeAtIndex(profile_index);
+ }
}
}
« no previous file with comments | « chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc ('k') | chrome/browser/signin/cross_device_promo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698