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

Unified Diff: chrome/browser/ui/views/app_list/app_list_controller_win.cc

Issue 13947002: Update App Launcher icons, splitting for Chromium, Chrome, Canary. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: selfnits Created 7 years, 8 months 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/browser/ui/views/app_list/app_list_controller_win.cc
diff --git a/chrome/browser/ui/views/app_list/app_list_controller_win.cc b/chrome/browser/ui/views/app_list/app_list_controller_win.cc
index 0f12ae4cfda54921a7c9e651e601a46afacf7579..4772e2dbc1b8571af8099465c75afcde943e7af4 100644
--- a/chrome/browser/ui/views/app_list/app_list_controller_win.cc
+++ b/chrome/browser/ui/views/app_list/app_list_controller_win.cc
@@ -47,7 +47,6 @@
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "grit/google_chrome_strings.h"
-#include "grit/theme_resources.h"
#include "ui/app_list/pagination_model.h"
#include "ui/app_list/views/app_list_view.h"
#include "ui/base/l10n/l10n_util.h"
@@ -60,6 +59,10 @@
#include "ui/views/widget/widget.h"
#include "win8/util/win8_util.h"
+#if defined(GOOGLE_CHROME_BUILD)
+#include "chrome/installer/util/install_util.h"
+#endif
+
#if defined(USE_AURA)
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
@@ -75,16 +78,24 @@ static const int kAnchorOffset = 25;
static const wchar_t kTrayClassName[] = L"Shell_TrayWnd";
// Icons are added to the resources of the DLL using icon names. The icon index
-// for the app list icon is named IDR_X_APP_LIST. Creating shortcuts needs to
-// specify a resource index, which are different to icon names. They are 0
-// based and contiguous. As Google Chrome builds have extra icons the icon for
-// Google Chrome builds need to be higher. Unfortunately these indexes are not
-// in any generated header file.
+// for the app list icon is named IDR_X_APP_LIST or (for official builds)
+// IDR_X_APP_LIST_SXS for Chrome Canary. Creating shortcuts needs to specify a
+// resource index, which are different to icon names. They are 0 based and
+// contiguous. As Google Chrome builds have extra icons the icon for Google
+// Chrome builds need to be higher. Unfortunately these indexes are not in any
+// generated header file.
+int GetAppListIconIndex() {
+ const int kAppListIconIndex = 5;
+ const int kAppListIconIndexSxS = 6;
+ const int kAppListIconIndexChromium = 1;
#if defined(GOOGLE_CHROME_BUILD)
-const int kAppListIconIndex = 5;
+ if (InstallUtil::IsChromeSxSProcess())
+ return kAppListIconIndexSxS;
+ return kAppListIconIndex;
#else
-const int kAppListIconIndex = 1;
+ return kAppListIconIndexChromium;
#endif
+}
CommandLine GetAppListCommandLine() {
const char* const kSwitchesToCopy[] = { switches::kUserDataDir };
@@ -332,7 +343,7 @@ gfx::NativeWindow AppListControllerDelegateWin::GetAppListWindow() {
gfx::ImageSkia AppListControllerDelegateWin::GetWindowIcon() {
gfx::ImageSkia* resource = ResourceBundle::GetSharedInstance().
- GetImageSkiaNamed(IDR_APP_LIST);
+ GetImageSkiaNamed(AppListService::GetAppListIconResourceId());
return *resource;
}
@@ -725,7 +736,7 @@ string16 AppListController::GetAppListIconPath() {
}
std::stringstream ss;
- ss << "," << kAppListIconIndex;
+ ss << "," << GetAppListIconIndex();
string16 result = icon_path.value();
result.append(UTF8ToUTF16(ss.str()));
return result;
@@ -871,7 +882,7 @@ void CheckAppListTaskbarShortcutOnFileThread(
shortcut_properties.set_arguments(wide_switches);
shortcut_properties.set_description(shortcut_name);
- shortcut_properties.set_icon(chrome_exe, kAppListIconIndex);
+ shortcut_properties.set_icon(chrome_exe, GetAppListIconIndex());
shortcut_properties.set_app_id(app_model_id);
base::win::CreateOrUpdateShortcutLink(shortcut_path, shortcut_properties,

Powered by Google App Engine
This is Rietveld 408576698