Commit 2e5b95d3 authored by Christopher Cameron's avatar Christopher Cameron Committed by Commit Bot

Fix elided slashes in PWA names

Set kCFBundleNameKey to be the app title. Leave the behavior of legacy
apps (not PWAs) unchanged.

Bug: 1021804
Change-Id: I0c4dbfc01cead79c3fad8b1bc7a9ddd1147c9bb8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2080471Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745595}
parent c4c11664
...@@ -1053,9 +1053,17 @@ bool WebAppShortcutCreator::UpdatePlist(const base::FilePath& app_path) const { ...@@ -1053,9 +1053,17 @@ bool WebAppShortcutCreator::UpdatePlist(const base::FilePath& app_path) const {
forKey:app_mode::kCFBundleDocumentTypesKey]; forKey:app_mode::kCFBundleDocumentTypesKey];
} }
base::FilePath app_name = app_path.BaseName().RemoveFinalExtension(); if (IsMultiProfile()) {
[plist setObject:base::mac::FilePathToNSString(app_name) [plist setObject:base::SysUTF16ToNSString(info_->title)
forKey:base::mac::CFToNSCast(kCFBundleNameKey)]; forKey:base::mac::CFToNSCast(kCFBundleNameKey)];
} else {
// The appropriate bundle name is |info_->title|. Avoiding changing the
// behavior of non-multi-profile apps when fixing
// https://crbug.com/1021804.
base::FilePath app_name = app_path.BaseName().RemoveFinalExtension();
[plist setObject:base::mac::FilePathToNSString(app_name)
forKey:base::mac::CFToNSCast(kCFBundleNameKey)];
}
return [plist writeToFile:plist_path atomically:YES]; return [plist writeToFile:plist_path atomically:YES];
} }
......
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