mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
Bug 1887868 - Only set Jump List App ID if the backend is available. r=win-reviewers,handyman
This also fixes an issue where we'd calculate the same App ID for normal and private browsing windows if taskbar.grouping.useprofile was set to true. Differential Revision: https://phabricator.services.mozilla.com/D205721
This commit is contained in:
parent
3098fb46bc
commit
1f9b0577b6
@ -176,8 +176,9 @@ JumpListBuilder::JumpListBuilder(const nsAString& aAppUserModelId,
|
||||
// the app, as it is set in the package manifest instead.
|
||||
if (!mozilla::widget::WinUtils::HasPackageIdentity()) {
|
||||
mIOThread->Dispatch(
|
||||
NewRunnableMethod<nsString>(
|
||||
"SetAppID", this, &JumpListBuilder::DoSetAppID, aAppUserModelId),
|
||||
NewRunnableMethod<nsString>("SetAppID", this,
|
||||
&JumpListBuilder::DoSetAppIDIfAvailable,
|
||||
aAppUserModelId),
|
||||
NS_DISPATCH_NORMAL);
|
||||
}
|
||||
}
|
||||
@ -203,10 +204,13 @@ void JumpListBuilder::DoShutdownBackend() {
|
||||
mJumpListBackend = nullptr;
|
||||
}
|
||||
|
||||
void JumpListBuilder::DoSetAppID(nsString aAppUserModelID) {
|
||||
void JumpListBuilder::DoSetAppIDIfAvailable(nsString aAppUserModelID) {
|
||||
MOZ_ASSERT(!NS_IsMainThread());
|
||||
MOZ_ASSERT(mJumpListBackend);
|
||||
mJumpListBackend->SetAppID(aAppUserModelID.get());
|
||||
|
||||
if (mJumpListBackend->IsAvailable()) {
|
||||
mJumpListBackend->SetAppID(aAppUserModelID.get());
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -64,7 +64,7 @@ class JumpListBuilder : public nsIJumpListBuilder, public nsIObserver {
|
||||
void DoSetupBackend();
|
||||
void DoSetupTestingBackend(RefPtr<JumpListBackend> aTestingBackend);
|
||||
void DoShutdownBackend();
|
||||
void DoSetAppID(nsString aAppUserModelID);
|
||||
void DoSetAppIDIfAvailable(nsString aAppUserModelID);
|
||||
void DoIsAvailable(const nsMainThreadPtrHandle<dom::Promise>& aPromiseHolder);
|
||||
void DoCheckForRemovals(
|
||||
const nsMainThreadPtrHandle<dom::Promise>& aPromiseHolder);
|
||||
|
@ -223,6 +223,11 @@ bool WinTaskbar::GenerateAppUserModelID(nsAString& aAppUserModelId,
|
||||
id.AppendInt(HashString(path));
|
||||
if (!id.IsEmpty()) {
|
||||
aAppUserModelId.Assign(id);
|
||||
|
||||
if (aPrivateBrowsing) {
|
||||
aAppUserModelId.AppendLiteral(";PrivateBrowsingAUMID");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user