summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-05 21:46:50 +0000
committermattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-05 21:46:50 +0000
commit07505a88eac040e4280d27d86f27b2252c92d706 (patch)
treec1e74fe605a2a5793754ff08cae5547615e7d1e3
parenta6de082421306f85d8d8f8115c3cc1bc1c094dcd (diff)
downloadchromium_src-07505a88eac040e4280d27d86f27b2252c92d706.zip
chromium_src-07505a88eac040e4280d27d86f27b2252c92d706.tar.gz
chromium_src-07505a88eac040e4280d27d86f27b2252c92d706.tar.bz2
Win SxS: Use SxS icon on the shortcuts in start menu, etc.
BUG=37119 TEST=build official mini_installer, install with and without --chrome-sxs, check icons of created entries Review URL: http://codereview.chromium.org/1959003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46502 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/chrome_exe.rc3
-rw-r--r--chrome/installer/util/shell_util.cc12
2 files changed, 13 insertions, 2 deletions
diff --git a/chrome/app/chrome_exe.rc b/chrome/app/chrome_exe.rc
index 2defc986..da84c04 100644
--- a/chrome/app/chrome_exe.rc
+++ b/chrome/app/chrome_exe.rc
@@ -62,6 +62,9 @@ END
// The application icon should: have the lowest ID, be placed first, and its
// resource name should be alphabetically less than the name of any other icon
// resource (http://msdn.microsoft.com/en-us/library/ms997538.aspx).
+// Note: chrome/installer/util/shell_util.cc depends on the order and number of
+// icons. To avoid breaking existing shortcuts, add new icons at the end
+// (following the ordering described above).
#if defined(GOOGLE_CHROME_BUILD)
IDR_MAINFRAME ICON "theme\google_chrome\chrome.ico"
IDR_MAINFRAME_2 ICON "theme\google_chrome\chrome2.ico"
diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc
index c61251b..e3c86f0 100644
--- a/chrome/installer/util/shell_util.cc
+++ b/chrome/installer/util/shell_util.cc
@@ -31,6 +31,9 @@
namespace {
+const int kDefaultIconIndex = 0;
+const int kSxSIconIndex = 4;
+
// This class represents a single registry entry. The objective is to
// encapsulate all the registry entries required for registering Chrome at one
// place. This class can not be instantiated outside the class and the objects
@@ -499,8 +502,11 @@ bool ShellUtil::CreateChromeQuickLaunchShortcut(const std::wstring& chrome_exe,
}
std::wstring ShellUtil::GetChromeIcon(const std::wstring& chrome_exe) {
+ BrowserDistribution* dist = BrowserDistribution::GetDistribution();
std::wstring chrome_icon(chrome_exe);
- chrome_icon.append(L",0");
+ chrome_icon.append(L",");
+ chrome_icon.append(IntToWString(dist->ShouldUseAlternateIcon() ?
+ kSxSIconIndex : kDefaultIconIndex));
return chrome_icon;
}
@@ -764,13 +770,15 @@ bool ShellUtil::UpdateChromeShortcut(const std::wstring& chrome_exe,
const std::wstring& shortcut,
const std::wstring& description,
bool create_new) {
+ BrowserDistribution* dist = BrowserDistribution::GetDistribution();
std::wstring chrome_path = file_util::GetDirectoryFromPath(chrome_exe);
FilePath prefs_path(chrome_path);
prefs_path = prefs_path.AppendASCII(installer_util::kDefaultMasterPrefs);
scoped_ptr<DictionaryValue> prefs(
installer_util::ParseDistributionPreferences(prefs_path));
- int icon_index = 0;
+ int icon_index = dist->ShouldUseAlternateIcon() ?
+ kSxSIconIndex : kDefaultIconIndex;
installer_util::GetDistroIntegerPreference(prefs.get(),
installer_util::master_preferences::kChromeShortcutIconIndex,
&icon_index);