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 273c7f0324170eda2e0fbd7b474fd1c4ac6dc724..dfd2fe40cfc6d6514a20ace3d0f2a9b94ec68fb7 100644 |
| --- a/chrome/installer/util/shell_util.cc |
| +++ b/chrome/installer/util/shell_util.cc |
| @@ -218,7 +218,8 @@ class RegistryEntry { |
| const string16& suffix, |
| ScopedVector<RegistryEntry>* entries) { |
| string16 icon_path( |
| - ShellUtil::FormatIconLocation(chrome_exe, dist->GetIconIndex())); |
| + ShellUtil::FormatIconLocation(chrome_exe, dist-> |
| + GetShortcutInfo(BrowserDistribution::SHORTCUT_CHROME).icon_index)); |
|
gab
2013/05/18 23:57:22
In general for this sort of wrapping use something
calamity
2013/05/24 02:03:11
Done.
|
| 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 |
| @@ -316,7 +317,7 @@ class RegistryEntry { |
| // resource for name, description, and company. |
| entries->push_back(new RegistryEntry( |
| chrome_application, ShellUtil::kRegApplicationName, |
| - dist->GetAppShortCutName())); |
| + dist->GetShortcutInfo(BrowserDistribution::SHORTCUT_CHROME).name)); |
|
huangs
2013/05/21 21:35:41
Might need another "name" routine; see comment in
|
| entries->push_back(new RegistryEntry( |
| chrome_application, ShellUtil::kRegApplicationDescription, |
| dist->GetAppDescription())); |
| @@ -349,7 +350,8 @@ class RegistryEntry { |
| const string16& suffix, |
| ScopedVector<RegistryEntry>* entries) { |
| const string16 icon_path( |
| - ShellUtil::FormatIconLocation(chrome_exe, dist->GetIconIndex())); |
| + ShellUtil::FormatIconLocation(chrome_exe, dist-> |
| + GetShortcutInfo(BrowserDistribution::SHORTCUT_CHROME).icon_index)); |
| const string16 quoted_exe_path(L"\"" + chrome_exe + L"\""); |
| // Register for the Start Menu "Internet" link (pre-Win7). |
| @@ -358,7 +360,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->GetShortcutInfo(BrowserDistribution::SHORTCUT_CHROME).name)); |
|
huangs
2013/05/21 21:35:41
Might need another "name" routine; see comment in
|
| // Register the "open" verb for launching Chrome via the "Internet" link. |
| entries->push_back(new RegistryEntry( |
| start_menu_entry + ShellUtil::kRegShellOpen, quoted_exe_path)); |
| @@ -394,7 +397,7 @@ class RegistryEntry { |
| capabilities, ShellUtil::kRegApplicationIcon, icon_path)); |
| entries->push_back(new RegistryEntry( |
| capabilities, ShellUtil::kRegApplicationName, |
| - dist->GetAppShortCutName())); |
| + dist->GetShortcutInfo(BrowserDistribution::SHORTCUT_CHROME).name)); |
| entries->push_back(new RegistryEntry(capabilities + L"\\Startmenu", |
| L"StartMenuInternet", reg_app_name)); |
| @@ -500,7 +503,8 @@ 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-> |
| + GetShortcutInfo(BrowserDistribution::SHORTCUT_CHROME).icon_index); |
| for (int i = 0; ShellUtil::kBrowserProtocolAssociations[i] != NULL; i++) { |
| GetXPStyleUserProtocolEntries(ShellUtil::kBrowserProtocolAssociations[i], |
| chrome_icon, chrome_open, entries); |
| @@ -905,7 +909,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-> |
| + GetShortcutInfo(BrowserDistribution::SHORTCUT_CHROME).icon_index)); |
| RegistryEntry::GetXPStyleUserProtocolEntries(protocol, chrome_icon, |
| chrome_open, &entries); |
| // Change the default protocol handler for current user. |
| @@ -918,17 +924,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->GetShortcutInfo(BrowserDistribution::SHORTCUT_CHROME).name. 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; |
|
huangs
2013/05/21 21:35:41
string shortcut_name(
properties.has_shortcut_
calamity
2013/05/24 02:03:11
Done.
calamity
2013/05/24 02:03:11
Done.
|
| - if (properties.has_shortcut_name()) |
| + if (properties.has_shortcut_name()) { |
| shortcut_name = properties.shortcut_name; |
| - else |
| - shortcut_name = dist->GetAppShortCutName(); |
| + } else { |
| + shortcut_name = |
| + dist->GetShortcutInfo(BrowserDistribution::SHORTCUT_CHROME).name; |
| + } |
| if (!EndsWith(shortcut_name, installer::kLnkExt, false)) |
| shortcut_name.append(installer::kLnkExt); |
| @@ -1396,8 +1404,10 @@ 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->GetShortcutInfo(BrowserDistribution::SHORTCUT_CHROME).name); |
|
huangs
2013/05/21 21:35:41
Add TODO.
calamity
2013/05/24 02:03:11
Done.
|
| + } |
| return true; |
| } |