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

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

Issue 15255004: Refactor of BrowserDistribution. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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
« no previous file with comments | « chrome/installer/util/google_chrome_sxs_distribution.h ('k') | chrome/installer/util/install_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/google_chrome_sxs_distribution.cc
diff --git a/chrome/installer/util/google_chrome_sxs_distribution.cc b/chrome/installer/util/google_chrome_sxs_distribution.cc
index 5224a8cfef6a47566c57bd631ae2254afc59f6d0..1e623d995e45a689b1e0562fc96cdccab5614868 100644
--- a/chrome/installer/util/google_chrome_sxs_distribution.cc
+++ b/chrome/installer/util/google_chrome_sxs_distribution.cc
@@ -18,6 +18,9 @@ const wchar_t kChannelName[] = L"canary";
const wchar_t kBrowserAppId[] = L"ChromeCanary";
const int kSxSIconIndex = 4;
+// The Chrome App Launcher Canary icon is index 6; see chrome_exe.rc.
+const int kSxSAppLauncherIconIndex = 6;
+
} // namespace
GoogleChromeSxSDistribution::GoogleChromeSxSDistribution()
@@ -29,10 +32,21 @@ string16 GoogleChromeSxSDistribution::GetBaseAppName() {
return L"Google Chrome Canary";
}
-string16 GoogleChromeSxSDistribution::GetAppShortCutName() {
- const string16& shortcut_name =
- installer::GetLocalizedString(IDS_SXS_SHORTCUT_NAME_BASE);
- return shortcut_name;
+string16 GoogleChromeSxSDistribution::GetShortcutName(
+ ShortcutType shortcut_type) {
+ switch (shortcut_type) {
+ case SHORTCUT_CHROME_ALTERNATE:
+ // This should never be called. Returning the same string as Google Chrome
+ // preserves behavior, but it will result in a naming collision.
+ NOTREACHED();
+ return GoogleChromeDistribution::GetShortcutName(shortcut_type);
+ case SHORTCUT_APP_LAUNCHER:
+ return installer::GetLocalizedString(
+ IDS_APP_LIST_SHORTCUT_NAME_CANARY_BASE);
+ default:
+ DCHECK_EQ(shortcut_type, SHORTCUT_CHROME);
+ return installer::GetLocalizedString(IDS_SXS_SHORTCUT_NAME_BASE);
+ }
}
string16 GoogleChromeSxSDistribution::GetBaseAppId() {
@@ -53,7 +67,11 @@ bool GoogleChromeSxSDistribution::CanSetAsDefault() {
return false;
}
-int GoogleChromeSxSDistribution::GetIconIndex() {
+int GoogleChromeSxSDistribution::GetIconIndex(ShortcutType shortcut_type) {
+ if (shortcut_type == SHORTCUT_APP_LAUNCHER)
+ return kSxSAppLauncherIconIndex;
+ DCHECK(shortcut_type == SHORTCUT_CHROME ||
+ shortcut_type == SHORTCUT_CHROME_ALTERNATE) << shortcut_type;
return kSxSIconIndex;
}
« no previous file with comments | « chrome/installer/util/google_chrome_sxs_distribution.h ('k') | chrome/installer/util/install_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698