| Index: chrome/browser/web_applications/web_app_mac.mm
|
| diff --git a/chrome/browser/web_applications/web_app_mac.mm b/chrome/browser/web_applications/web_app_mac.mm
|
| index aaa84468fc4000a01a92bcbb37aec064e106ef7b..091a667ba8cafbd52080c97221cdb189fcd3069f 100644
|
| --- a/chrome/browser/web_applications/web_app_mac.mm
|
| +++ b/chrome/browser/web_applications/web_app_mac.mm
|
| @@ -743,13 +743,16 @@ bool WebAppShortcutCreator::CreateShortcuts(
|
| path_to_add_to_dock = base::SysUTF8ToNSString(
|
| applications_dir.Append(GetShortcutBasename()).AsUTF8Unsafe());
|
| } else {
|
| + base::DeleteFile(GetInternalShortcutPath(), true);
|
| paths.push_back(app_data_dir_);
|
| }
|
|
|
| bool shortcut_visible =
|
| creation_locations.applications_menu_location != APP_MENU_LOCATION_HIDDEN;
|
| - if (shortcut_visible)
|
| + if (shortcut_visible) {
|
| + base::DeleteFile(GetApplicationsShortcutPath(), true);
|
| paths.push_back(applications_dir);
|
| + }
|
|
|
| DCHECK(!paths.empty());
|
| size_t success_count = CreateShortcutsIn(paths);
|
| @@ -897,9 +900,13 @@ bool WebAppShortcutCreator::UpdatePlist(const base::FilePath& app_path) const {
|
|
|
| bool WebAppShortcutCreator::UpdateDisplayName(
|
| const base::FilePath& app_path) const {
|
| - // OSX searches for the best language in the order of preferred languages.
|
| - // Since we only have one localization directory, it will choose this one.
|
| - base::FilePath localized_dir = GetResourcesPath(app_path).Append("en.lproj");
|
| + // Localization is used to display the app name (rather than the bundle
|
| + // filename). OSX searches for the best language in the order of preferred
|
| + // languages, but one of them must be found otherwise it will default to
|
| + // the filename.
|
| + NSString* language = [[NSLocale preferredLanguages] objectAtIndex:0];
|
| + base::FilePath localized_dir = GetResourcesPath(app_path).Append(
|
| + base::SysNSStringToUTF8(language) + ".lproj");
|
| if (!base::CreateDirectory(localized_dir))
|
| return false;
|
|
|
|
|