Commit 6f416979 authored by Shakti Sahu's avatar Shakti Sahu Committed by Commit Bot

Initilaize SimpleDownloadManagerCoordinator for incognito correctly

This issue occurs when we open new incognito tab directly from the
launcher.  The issue is that both regular and incognito profile get
created at the same time and we miss the NOTIFICATION_PROFILE_CREATED
event for which we register later. This results in not creating the
SimpleDownloadManagerCoordinator for incognito, thereby missing all
the download updates. A solution is to check if we already have a
incognito profile, and initialize the SimpleDownloadManagerCoordinator
for that.

Bug: 980570
Change-Id: I1196e2ca2e15978dd0ac15fffc51f8ab99c267c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1717625Reviewed-by: default avatarShakti Sahu <shaktisahu@chromium.org>
Reviewed-by: default avatarXing Liu <xingliu@chromium.org>
Commit-Queue: Shakti Sahu <shaktisahu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681118}
parent 29fde33c
...@@ -220,8 +220,14 @@ void DownloadManagerService::Init(JNIEnv* env, ...@@ -220,8 +220,14 @@ void DownloadManagerService::Init(JNIEnv* env,
void DownloadManagerService::OnFullBrowserStarted(JNIEnv* env, jobject obj) { void DownloadManagerService::OnFullBrowserStarted(JNIEnv* env, jobject obj) {
registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CREATED, registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CREATED,
content::NotificationService::AllSources()); content::NotificationService::AllSources());
Profile* profile = ProfileManager::GetActiveUserProfile(); // Register coordinator for each available profile.
Profile* profile =
ProfileManager::GetActiveUserProfile()->GetOriginalProfile();
ResetCoordinatorIfNeeded(profile->GetProfileKey()); ResetCoordinatorIfNeeded(profile->GetProfileKey());
if (profile->HasOffTheRecordProfile()) {
ResetCoordinatorIfNeeded(
profile->GetOffTheRecordProfile()->GetProfileKey());
}
} }
void DownloadManagerService::Observe( void DownloadManagerService::Observe(
......
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