Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8486)

Unified Diff: chrome/installer/util/shell_util.cc

Issue 11359133: Add default icon to app_host.exe, and use it in shortcuts during installation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Small comment change. Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/installer/util/shell_util.cc
diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc
index 6cfaf5f9fac4dcad9b27403a1266cb3f3e0f4b79..50a515d632f180e077e530db0e7031d7af4b3fb2 100644
--- a/chrome/installer/util/shell_util.cc
+++ b/chrome/installer/util/shell_util.cc
@@ -215,7 +215,8 @@ class RegistryEntry {
const string16& chrome_exe,
const string16& suffix,
ScopedVector<RegistryEntry>* entries) {
- string16 icon_path(ShellUtil::GetChromeIcon(dist, chrome_exe));
+ string16 icon_path(ShellUtil::GetIconString(chrome_exe,
+ dist->GetIconIndex()));
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
@@ -345,7 +346,8 @@ class RegistryEntry {
const string16& chrome_exe,
const string16& suffix,
ScopedVector<RegistryEntry>* entries) {
- const string16 icon_path(ShellUtil::GetChromeIcon(dist, chrome_exe));
+ const string16 icon_path(
+ ShellUtil::GetIconString(chrome_exe, dist->GetIconIndex()));
const string16 quoted_exe_path(L"\"" + chrome_exe + L"\"");
// Register for the Start Menu "Internet" link (pre-Win7).
@@ -495,7 +497,8 @@ class RegistryEntry {
// Protocols associations.
string16 chrome_open = ShellUtil::GetChromeShellOpenCmd(chrome_exe);
- string16 chrome_icon = ShellUtil::GetChromeIcon(dist, chrome_exe);
+ string16 chrome_icon = ShellUtil::GetIconString(chrome_exe,
+ dist->GetIconIndex());
for (int i = 0; ShellUtil::kBrowserProtocolAssociations[i] != NULL; i++) {
GetXPStyleUserProtocolEntries(ShellUtil::kBrowserProtocolAssociations[i],
chrome_icon, chrome_open, entries);
@@ -895,7 +898,8 @@ bool RegisterChromeAsDefaultProtocolClientXPStyle(BrowserDistribution* dist,
const string16& protocol) {
ScopedVector<RegistryEntry> entries;
const string16 chrome_open(ShellUtil::GetChromeShellOpenCmd(chrome_exe));
- const string16 chrome_icon(ShellUtil::GetChromeIcon(dist, chrome_exe));
+ const string16 chrome_icon(
+ ShellUtil::GetIconString(chrome_exe, dist->GetIconIndex()));
RegistryEntry::GetXPStyleUserProtocolEntries(protocol, chrome_icon,
chrome_open, &entries);
// Change the default protocol handler for current user.
@@ -1320,12 +1324,12 @@ bool ShellUtil::CreateOrUpdateShortcut(
return ret;
}
-string16 ShellUtil::GetChromeIcon(BrowserDistribution* dist,
- const string16& chrome_exe) {
- string16 chrome_icon(chrome_exe);
- chrome_icon.append(L",");
- chrome_icon.append(base::IntToString16(dist->GetIconIndex()));
- return chrome_icon;
+string16 ShellUtil::GetIconString(const string16& icon_path,
+ int icon_index) {
+ string16 icon_string(icon_path);
+ icon_string.append(L",");
+ icon_string.append(base::IntToString16(icon_index));
+ return icon_string;
}
string16 ShellUtil::GetChromeShellOpenCmd(const string16& chrome_exe) {
« chrome/installer/setup/install_worker.cc ('K') | « chrome/installer/util/shell_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698