Chromium Code Reviews| Index: chrome/installer/setup/install.cc |
| diff --git a/chrome/installer/setup/install.cc b/chrome/installer/setup/install.cc |
| index 744af926972ec5fa5d07687713591f568cb17cd1..1e4a2c0e76a895748e83773d54f22723157f1e46 100644 |
| --- a/chrome/installer/setup/install.cc |
| +++ b/chrome/installer/setup/install.cc |
| @@ -282,14 +282,24 @@ void UpdatePerUserShortcutsInLocation( |
| base::FileEnumerator::FILES); |
| for (base::FilePath shortcut = shortcuts_enum.Next(); !shortcut.empty(); |
| shortcut = shortcuts_enum.Next()) { |
| - base::FilePath existing_target_path; |
| - if (!base::win::ResolveShortcut(shortcut, &existing_target_path, nullptr) || |
| - !base::StartsWith(existing_target_path.value(), |
| - old_target_dir.AsEndingWithSeparator().value(), |
| - base::CompareCase::INSENSITIVE_ASCII) || |
| - !base::EndsWith(existing_target_path.value(), |
| - old_target_path_suffix.value(), |
| - base::CompareCase::INSENSITIVE_ASCII)) { |
| + base::win::ShortcutProperties shortcut_properties; |
| + if (!base::win::ResolveShortcutProperties( |
| + shortcut, (base::win::ShortcutProperties::PROPERTIES_TARGET | |
| + base::win::ShortcutProperties::PROPERTIES_ICON), |
| + &shortcut_properties)) { |
| + continue; |
| + } |
| + |
| + // TODO(fdoray): Stop using the icon to identify shortcuts that need to be |
| + // updated in May 2016. This is just intended to fix shortcuts broken by |
| + // crbug.com/595374. |
| + if (!(base::StartsWith(shortcut_properties.target.value(), |
| + old_target_dir.AsEndingWithSeparator().value(), |
| + base::CompareCase::INSENSITIVE_ASCII) && |
| + base::EndsWith(shortcut_properties.target.value(), |
| + old_target_path_suffix.value(), |
| + base::CompareCase::INSENSITIVE_ASCII)) && |
| + !old_target_dir.IsParent(shortcut_properties.icon)) { |
|
gab
2016/03/17 20:14:23
I had a hard time reading this logic, I'd say add
gab
2016/03/17 20:14:23
How about we do path comparison everywhere instead
fdoray
2016/03/18 14:08:59
Done.
fdoray
2016/03/18 14:08:59
Done.
|
| continue; |
| } |