Chromium Code Reviews| Index: chrome/installer/util/shell_util.cc |
| diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc |
| index 19958c66ff317b6da7a06a514697c512170346f3..f9dcb3361a72e276c3340177f10b9100e8badedb 100644 |
| --- a/chrome/installer/util/shell_util.cc |
| +++ b/chrome/installer/util/shell_util.cc |
| @@ -219,7 +219,9 @@ class RegistryEntry { |
| const string16& suffix, |
| ScopedVector<RegistryEntry>* entries) { |
| string16 icon_path( |
| - ShellUtil::FormatIconLocation(chrome_exe, dist->GetIconIndex())); |
| + ShellUtil::FormatIconLocation( |
| + chrome_exe, |
| + dist->GetIconIndex(BrowserDistribution::SHORTCUT_CHROME))); |
| string16 open_cmd(ShellUtil::GetChromeShellOpenCmd(chrome_exe)); |
| string16 delegate_command(ShellUtil::GetChromeDelegateCommand(chrome_exe)); |
| // For user-level installs: entries for the app id and DelegateExecute verb |
| @@ -317,7 +319,7 @@ class RegistryEntry { |
| // resource for name, description, and company. |
| entries->push_back(new RegistryEntry( |
| chrome_application, ShellUtil::kRegApplicationName, |
| - dist->GetAppShortCutName())); |
| + dist->GetDisplayName())); |
| entries->push_back(new RegistryEntry( |
| chrome_application, ShellUtil::kRegApplicationDescription, |
| dist->GetAppDescription())); |
| @@ -350,7 +352,9 @@ class RegistryEntry { |
| const string16& suffix, |
| ScopedVector<RegistryEntry>* entries) { |
| const string16 icon_path( |
| - ShellUtil::FormatIconLocation(chrome_exe, dist->GetIconIndex())); |
| + ShellUtil::FormatIconLocation( |
| + chrome_exe, |
| + dist->GetIconIndex(BrowserDistribution::SHORTCUT_CHROME))); |
| const string16 quoted_exe_path(L"\"" + chrome_exe + L"\""); |
| // Register for the Start Menu "Internet" link (pre-Win7). |
| @@ -359,7 +363,8 @@ class RegistryEntry { |
| // TODO(grt): http://crbug.com/75152 Also set LocalizedString; see |
| // http://msdn.microsoft.com/en-us/library/windows/desktop/cc144109(v=VS.85).aspx#registering_the_display_name |
| entries->push_back(new RegistryEntry( |
| - start_menu_entry, dist->GetAppShortCutName())); |
| + start_menu_entry, |
| + dist->GetDisplayName())); |
| // Register the "open" verb for launching Chrome via the "Internet" link. |
| entries->push_back(new RegistryEntry( |
| start_menu_entry + ShellUtil::kRegShellOpen, quoted_exe_path)); |
| @@ -395,7 +400,7 @@ class RegistryEntry { |
| capabilities, ShellUtil::kRegApplicationIcon, icon_path)); |
| entries->push_back(new RegistryEntry( |
| capabilities, ShellUtil::kRegApplicationName, |
| - dist->GetAppShortCutName())); |
| + dist->GetDisplayName())); |
| entries->push_back(new RegistryEntry(capabilities + L"\\Startmenu", |
| L"StartMenuInternet", reg_app_name)); |
| @@ -501,7 +506,9 @@ class RegistryEntry { |
| // Protocols associations. |
| string16 chrome_open = ShellUtil::GetChromeShellOpenCmd(chrome_exe); |
| string16 chrome_icon = |
| - ShellUtil::FormatIconLocation(chrome_exe, dist->GetIconIndex()); |
| + ShellUtil::FormatIconLocation( |
| + chrome_exe, |
| + dist->GetIconIndex(BrowserDistribution::SHORTCUT_CHROME)); |
| for (int i = 0; ShellUtil::kBrowserProtocolAssociations[i] != NULL; i++) { |
| GetXPStyleUserProtocolEntries(ShellUtil::kBrowserProtocolAssociations[i], |
| chrome_icon, chrome_open, entries); |
| @@ -906,7 +913,9 @@ bool RegisterChromeAsDefaultProtocolClientXPStyle(BrowserDistribution* dist, |
| ScopedVector<RegistryEntry> entries; |
| const string16 chrome_open(ShellUtil::GetChromeShellOpenCmd(chrome_exe)); |
| const string16 chrome_icon( |
| - ShellUtil::FormatIconLocation(chrome_exe, dist->GetIconIndex())); |
| + ShellUtil::FormatIconLocation( |
| + chrome_exe, |
| + dist->GetIconIndex(BrowserDistribution::SHORTCUT_CHROME))); |
| RegistryEntry::GetXPStyleUserProtocolEntries(protocol, chrome_icon, |
| chrome_open, &entries); |
| // Change the default protocol handler for current user. |
| @@ -919,17 +928,19 @@ bool RegisterChromeAsDefaultProtocolClientXPStyle(BrowserDistribution* dist, |
| } |
| // Returns |properties.shortcut_name| if the property is set, otherwise it |
| -// returns dist->GetAppShortcutName(). In any case, it makes sure the |
| -// return value is suffixed with ".lnk". |
| +// returns dist->GetShortcutName(BrowserDistribution::SHORTCUT_CHROME). In any |
| +// case, it makes sure the return value is suffixed with ".lnk". |
| string16 ExtractShortcutNameFromProperties( |
| BrowserDistribution* dist, |
| const ShellUtil::ShortcutProperties& properties) { |
| DCHECK(dist); |
| string16 shortcut_name; |
| - if (properties.has_shortcut_name()) |
| + if (properties.has_shortcut_name()) { |
| shortcut_name = properties.shortcut_name; |
| - else |
| - shortcut_name = dist->GetAppShortCutName(); |
| + } else { |
| + shortcut_name = |
| + dist->GetShortcutName(BrowserDistribution::SHORTCUT_CHROME); |
| + } |
| if (!EndsWith(shortcut_name, installer::kLnkExt, false)) |
| shortcut_name.append(installer::kLnkExt); |
| @@ -1397,8 +1408,11 @@ bool ShellUtil::GetShortcutPath(ShellUtil::ShortcutLocation location, |
| return false; |
| } |
| - if (add_folder_for_dist) |
| - *path = path->Append(dist->GetAppShortCutName()); |
| + if (add_folder_for_dist) { |
| + *path = path->Append( |
| + dist->GetStartMenuShortcutSubfolder( |
|
gab
2013/06/27 11:49:43
nit: This likely fits on the previous line now.
calamity
2013/07/05 09:00:29
Done.
|
| + BrowserDistribution::SUBFOLDER_CHROME)); |
|
gab
2013/06/27 11:49:43
nit: Indent 2 more spaces.
(or 2 less if comment
calamity
2013/07/05 09:00:29
Done.
|
| + } |
| return true; |
| } |
| @@ -1493,6 +1507,7 @@ bool ShellUtil::CreateOrUpdateShortcut( |
| string16 ShellUtil::FormatIconLocation(const string16& icon_path, |
| int icon_index) { |
| + BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
|
gab
2013/06/27 11:49:43
Remove this line.
calamity
2013/07/05 09:00:29
Done.
|
| string16 icon_string(icon_path); |
| icon_string.append(L","); |
| icon_string.append(base::IntToString16(icon_index)); |