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

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: rework Created 7 years, 5 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/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..e56d44e05f3b21d91f257545219eab8fa409fbf2 100644
--- a/chrome/installer/util/google_chrome_sxs_distribution.cc
+++ b/chrome/installer/util/google_chrome_sxs_distribution.cc
@@ -17,6 +17,7 @@ const wchar_t kChromeSxSGuid[] = L"{4ea16ac7-fd5a-47c3-875b-dbf4a2008c20}";
const wchar_t kChannelName[] = L"canary";
const wchar_t kBrowserAppId[] = L"ChromeCanary";
const int kSxSIconIndex = 4;
+const int kSxSAppLauncherIconIndex = 6;
} // namespace
@@ -29,10 +30,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 +65,12 @@ bool GoogleChromeSxSDistribution::CanSetAsDefault() {
return false;
}
-int GoogleChromeSxSDistribution::GetIconIndex() {
+int GoogleChromeSxSDistribution::GetIconIndex(ShortcutType shortcut_type) {
+ // The Chrome App Launcher Canary icon is index 6; see chrome_exe.rc.
grt (UTC plus 2) 2013/07/16 19:38:44 please move this comment up to the definition of k
calamity 2013/07/18 07:56:14 Done.
+ if (shortcut_type == SHORTCUT_APP_LAUNCHER)
+ return kSxSAppLauncherIconIndex;
+ DCHECK(shortcut_type == SHORTCUT_CHROME ||
+ shortcut_type == SHORTCUT_CHROME_ALTERNATE) << shortcut_type;
return kSxSIconIndex;
}

Powered by Google App Engine
This is Rietveld 408576698