summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorhuangs@chromium.org <huangs@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-09 01:43:00 +0000
committerhuangs@chromium.org <huangs@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-09 01:43:00 +0000
commit4c72ca5f0796e8da1a79b2edd96afe17b493ff2f (patch)
tree02833ce580f4a93e080461daf3dd5f55033a7773 /chrome
parentb38d4c26b93edf23b1f3733196069a4006d3405e (diff)
downloadchromium_src-4c72ca5f0796e8da1a79b2edd96afe17b493ff2f.zip
chromium_src-4c72ca5f0796e8da1a79b2edd96afe17b493ff2f.tar.gz
chromium_src-4c72ca5f0796e8da1a79b2edd96afe17b493ff2f.tar.bz2
Fixing App Launcher shortcut icons, including uninstall shortcut.
BUG=151626 Review URL: https://chromiumcodereview.appspot.com/11371007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166836 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/installer/setup/install_worker.cc2
-rw-r--r--chrome/installer/util/chrome_app_host_distribution.cc9
-rw-r--r--chrome/installer/util/chrome_app_host_distribution.h2
-rw-r--r--chrome/installer/util/chrome_app_host_operations.cc12
4 files changed, 25 insertions, 0 deletions
diff --git a/chrome/installer/setup/install_worker.cc b/chrome/installer/setup/install_worker.cc
index 3929d07..2ef5660 100644
--- a/chrome/installer/setup/install_worker.cc
+++ b/chrome/installer/setup/install_worker.cc
@@ -621,6 +621,8 @@ void AddUninstallShortcutWorkItems(const InstallerState& installer_state,
install_path.value(),
true);
+ // TODO(huangs): Generalize this, so app_host.exe can get its own icon,
+ // and not rely on chrome.exe's.
// DisplayIcon, NoModify and NoRepair
string16 chrome_icon = ShellUtil::GetChromeIcon(
product.distribution(),
diff --git a/chrome/installer/util/chrome_app_host_distribution.cc b/chrome/installer/util/chrome_app_host_distribution.cc
index 744da24..69eba10 100644
--- a/chrome/installer/util/chrome_app_host_distribution.cc
+++ b/chrome/installer/util/chrome_app_host_distribution.cc
@@ -22,6 +22,11 @@
namespace {
+#if defined(GOOGLE_CHROME_BUILD)
+const int kAppListIconIndex = 5;
+#else
+const int kAppListIconIndex = 1;
+#endif
const wchar_t kChromeAppHostGuid[] = L"{FDA71E6F-AC4C-4a00-8B70-9958A68906BF}";
} // namespace
@@ -134,6 +139,10 @@ bool ChromeAppHostDistribution::CanCreateDesktopShortcuts() {
return true;
}
+int ChromeAppHostDistribution::GetIconIndex() {
+ return kAppListIconIndex;
+}
+
bool ChromeAppHostDistribution::GetCommandExecuteImplClsid(
string16* handler_class_uuid) {
return false;
diff --git a/chrome/installer/util/chrome_app_host_distribution.h b/chrome/installer/util/chrome_app_host_distribution.h
index 2f55069..9da219d 100644
--- a/chrome/installer/util/chrome_app_host_distribution.h
+++ b/chrome/installer/util/chrome_app_host_distribution.h
@@ -53,6 +53,8 @@ class ChromeAppHostDistribution : public BrowserDistribution {
virtual bool CanCreateDesktopShortcuts() OVERRIDE;
+ virtual int GetIconIndex() OVERRIDE;
+
virtual bool GetCommandExecuteImplClsid(
string16* handler_class_uuid) OVERRIDE;
diff --git a/chrome/installer/util/chrome_app_host_operations.cc b/chrome/installer/util/chrome_app_host_operations.cc
index 3c56a07..73b4056 100644
--- a/chrome/installer/util/chrome_app_host_operations.cc
+++ b/chrome/installer/util/chrome_app_host_operations.cc
@@ -120,11 +120,23 @@ void ChromeAppHostOperations::AddDefaultShortcutProperties(
ShellUtil::ShortcutProperties* properties) const {
if (!properties->has_target())
properties->set_target(target_exe);
+
if (!properties->has_arguments()) {
CommandLine app_host_args(CommandLine::NO_PROGRAM);
app_host_args.AppendSwitch(::switches::kShowAppList);
properties->set_arguments(app_host_args.GetCommandLineString());
}
+
+ if (!properties->has_icon()) {
+ // Currently the App Launcher icon is inside chrome.exe, which we assume
+ // to be located in the same directory as app_host.exe.
+ // TODO(huangs): Cause the icon to also be embedded in app_host.exe,
+ // and then point at this (as chrome.exe is _not_ in the same folder
+ // for system-level chrome installs, or may even be uninstalled).
+ FilePath chrome_exe(target_exe.DirName().Append(kChromeExe));
+ properties->set_icon(chrome_exe, dist->GetIconIndex());
+ }
+
if (!properties->has_app_id()) {
std::vector<string16> components;
string16 suffix;