Chromium Code Reviews| Index: chrome/installer/setup/install.cc |
| diff --git a/chrome/installer/setup/install.cc b/chrome/installer/setup/install.cc |
| index a076ca3a6efbd8ed4e23c021e2b10544f10d851c..d7d43b77080dea9b171b777e05a62a9eb9c47e23 100644 |
| --- a/chrome/installer/setup/install.cc |
| +++ b/chrome/installer/setup/install.cc |
| @@ -70,7 +70,10 @@ void LogShortcutOperation(ShellUtil::ShortcutLocation location, |
| case ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH: |
| message.append("Quick Launch "); |
| break; |
| - case ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR: |
| + case ShellUtil::SHORTCUT_LOCATION_START_MENU_ROOT: |
| + message.append("Start menu "); |
| + break; |
| + case ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED: |
| message.append("Start menu/" + |
| base::UTF16ToUTF8(dist->GetStartMenuShortcutSubfolder( |
| BrowserDistribution::SUBFOLDER_CHROME)) + |
| @@ -116,7 +119,7 @@ void LogShortcutOperation(ShellUtil::ShortcutLocation location, |
| VLOG(1) << message; |
| } |
| -void ExecuteAndLogShortcutOperation( |
| +bool ExecuteAndLogShortcutOperation( |
|
grt (UTC plus 2)
2015/10/19 17:28:44
this return value is unused. why introduce it?
grt (UTC plus 2)
2015/10/20 18:10:30
ping
bcwhite
2015/10/20 18:25:43
I left it in in because it's not really extra code
|
| ShellUtil::ShortcutLocation location, |
| BrowserDistribution* dist, |
| const ShellUtil::ShortcutProperties& properties, |
| @@ -125,7 +128,9 @@ void ExecuteAndLogShortcutOperation( |
| if (!ShellUtil::CreateOrUpdateShortcut(location, dist, properties, |
| operation)) { |
| LogShortcutOperation(location, dist, properties, operation, true); |
| + return false; |
| } |
| + return true; |
| } |
| void AddChromeToMediaPlayerList() { |
| @@ -434,8 +439,23 @@ void CreateOrUpdateShortcuts( |
| // remains disabled long term. |
| start_menu_properties.set_pin_to_start(false); |
| } |
| + |
| + // Move start-menu shortcuts out of the deprecated Chrome specific subfolder. |
|
grt (UTC plus 2)
2015/10/19 17:28:45
is plural correct here? is there ever more than on
bcwhite
2015/10/20 16:02:13
Done.
|
| + // This needs to happen before the shortcut update below or it will fail due |
|
grt (UTC plus 2)
2015/10/19 17:28:45
nit: "or it will" -> "or the latter will"
bcwhite
2015/10/20 16:02:13
Done.
|
| + // to the existing shortcut not being in the location as the new one. |
|
grt (UTC plus 2)
2015/10/19 17:28:44
suggestion: "the existing shortcut not being in th
bcwhite
2015/10/20 16:02:13
That would be incorrect. It fails below not becau
grt (UTC plus 2)
2015/10/20 18:10:30
I still find this wording awkward. The call to Exe
bcwhite
2015/10/20 18:25:43
I see. I think of it as two different shortcuts,
|
| + base::FilePath old_shortcut_path; |
| + ShellUtil::GetShortcutPath( |
| + ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED, dist, |
| + shortcut_level, &old_shortcut_path); |
| + if (base::PathExists(old_shortcut_path)) { |
| + ShellUtil::MoveExistingShortcut( |
| + ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED, |
| + ShellUtil::SHORTCUT_LOCATION_START_MENU_ROOT, |
| + dist, shortcut_level, start_menu_properties); |
| + } |
| + |
| ExecuteAndLogShortcutOperation( |
| - ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, dist, |
| + ShellUtil::SHORTCUT_LOCATION_START_MENU_ROOT, dist, |
| start_menu_properties, shortcut_operation); |
| } |