summaryrefslogtreecommitdiffstats
path: root/chrome/installer/util/shell_util.cc
diff options
context:
space:
mode:
authorkuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-03 21:42:37 +0000
committerkuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-03 21:42:37 +0000
commit6f2e2824b8143ee4d6c8845b4c17e106acaa04f4 (patch)
treef8f816ceba805db9ed2f05f55f900bf474f4a8e4 /chrome/installer/util/shell_util.cc
parent720ce12948a8289f76877927750d9c8f8878b4d1 (diff)
downloadchromium_src-6f2e2824b8143ee4d6c8845b4c17e106acaa04f4.zip
chromium_src-6f2e2824b8143ee4d6c8845b4c17e106acaa04f4.tar.gz
chromium_src-6f2e2824b8143ee4d6c8845b4c17e106acaa04f4.tar.bz2
Use alternate icon for Chrome shortcuts if specified in master preferences.
This change depends on change 159539 that is currently under review and a new chrome2.ico that is yet to be added to the repository. BUG=12701 TEST=Specify an alternate icon in --installerdata file and make sure that icon is used for shortcuts and it not changed later by updates. Review URL: http://codereview.chromium.org/159618 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22314 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/util/shell_util.cc')
-rw-r--r--chrome/installer/util/shell_util.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc
index d157f02..10355b6 100644
--- a/chrome/installer/util/shell_util.cc
+++ b/chrome/installer/util/shell_util.cc
@@ -25,6 +25,7 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/installer/util/browser_distribution.h"
#include "chrome/installer/util/install_util.h"
+#include "chrome/installer/util/master_preferences.h"
#include "installer_util_strings.h"
@@ -768,14 +769,23 @@ bool ShellUtil::UpdateChromeShortcut(const std::wstring& chrome_exe,
const std::wstring& description,
bool create_new) {
std::wstring chrome_path = file_util::GetDirectoryFromPath(chrome_exe);
+
if (create_new) {
+ FilePath prefs_path(chrome_path);
+ prefs_path = prefs_path.Append(installer_util::kDefaultMasterPrefs);
+ scoped_ptr<DictionaryValue> prefs(
+ installer_util::ParseDistributionPreferences(prefs_path));
+ int icon_index = 0;
+ installer_util::GetDistroIntegerPreference(prefs.get(),
+ installer_util::master_preferences::kChromeShortcutIconIndex,
+ &icon_index);
return file_util::CreateShortcutLink(chrome_exe.c_str(), // target
shortcut.c_str(), // shortcut
chrome_path.c_str(), // working dir
NULL, // arguments
description.c_str(), // description
chrome_exe.c_str(), // icon file
- 0); // icon index
+ icon_index); // icon index
} else {
return file_util::UpdateShortcutLink(chrome_exe.c_str(), // target
shortcut.c_str(), // shortcut