Commit 08757f1e authored by Elly Fong-Jones's avatar Elly Fong-Jones Committed by Commit Bot

cocoa: prompt for in-progress incognito downloads at quit

The code in [AppController shouldQuitWithInProgressDownloads] needs to account
for the fact that incognito profiles have separate DownloadManagers from their
parent profiles. This change does this by considering incognito profiles as
though they were regular profiles.

1) Create a profile, create an incognito window from it, start a download,
   quit Chrome: a "cancel download?" prompt should now appear.
2) Create a profile, create an incognito window from it, quit Chrome: no
   "cancel download?" prompt should appear.
3) Create a profile, start a download, quit Chrome: a "cancel download?" prompt
   should appear as before.
4) Create a profile, quit Chrome: no "cancel download?" prompt should appear.

Bug: 88419
Test: Manual
Change-Id: Ib25995c45ae99f3b1fe00b15a37108399be06f77
Reviewed-on: https://chromium-review.googlesource.com/895802
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533290}
parent 582aaa86
...@@ -857,6 +857,14 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; ...@@ -857,6 +857,14 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session;
return YES; return YES;
std::vector<Profile*> profiles(profile_manager->GetLoadedProfiles()); std::vector<Profile*> profiles(profile_manager->GetLoadedProfiles());
std::vector<Profile*> added_profiles;
for (Profile* p : profiles) {
if (p->HasOffTheRecordProfile())
added_profiles.push_back(p->GetOffTheRecordProfile());
}
profiles.insert(profiles.end(), added_profiles.begin(), added_profiles.end());
for (size_t i = 0; i < profiles.size(); ++i) { for (size_t i = 0; i < profiles.size(); ++i) {
DownloadCoreService* download_core_service = DownloadCoreService* download_core_service =
DownloadCoreServiceFactory::GetForBrowserContext(profiles[i]); DownloadCoreServiceFactory::GetForBrowserContext(profiles[i]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment