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

Unified Diff: chrome/installer/util/browser_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/browser_distribution.cc
diff --git a/chrome/installer/util/browser_distribution.cc b/chrome/installer/util/browser_distribution.cc
index 4f711419db140c7338e7eeaeef6331f99c93f301..9847c362071da8d49ef81bd6125ffac17c4891fd 100644
--- a/chrome/installer/util/browser_distribution.cc
+++ b/chrome/installer/util/browser_distribution.cc
@@ -66,6 +66,9 @@ BrowserDistribution::Type GetCurrentDistributionType() {
} // end namespace
+const char* BrowserDistribution::kDefaultAlternateChromeShortcutName =
gab 2013/07/05 14:23:37 Actually, this probably belongs more at the bottom
grt (UTC plus 2) 2013/07/05 17:27:37 comment on comment: my gut tells me that static in
+ "The Internet";
+
BrowserDistribution::BrowserDistribution()
: type_(CHROME_BROWSER) {
}
@@ -154,12 +157,33 @@ string16 BrowserDistribution::GetBaseAppName() {
return L"Chromium";
}
-string16 BrowserDistribution::GetAppShortCutName() {
- return GetBaseAppName();
+string16 BrowserDistribution::GetDisplayName() {
+ return GetShortcutName(SHORTCUT_CHROME);
}
-string16 BrowserDistribution::GetAlternateApplicationName() {
- return L"The Internet";
+string16 BrowserDistribution::GetShortcutName(ShortcutType shortcut_type) {
+ switch (shortcut_type) {
grt (UTC plus 2) 2013/07/05 17:27:37 for all functions like this, make the NOTREACHED c
calamity 2013/07/16 04:05:17 Done. Any reason to use DCHECK_EQ instead of NOTRE
grt (UTC plus 2) 2013/07/16 19:38:44 DCHECK_EQ will show the value that shouldn't have
+ case SHORTCUT_CHROME:
+ return GetBaseAppName();
+ case SHORTCUT_ALTERNATE_CHROME:
+ return L"The Internet";
+ case SHORTCUT_APP_LAUNCHER:
+ return L"Chromium App Launcher";
+ default:
+ NOTREACHED();
+ return string16();
+ }
+}
+
+string16 BrowserDistribution::GetStartMenuShortcutSubfolder(
+ Subfolder subfolder_type) {
+ switch (subfolder_type) {
grt (UTC plus 2) 2013/07/05 17:27:37 as above: DCHECK_EQ(subfolder_type, SUBFOLDER_CH
calamity 2013/07/16 04:05:17 Done.
+ case SUBFOLDER_CHROME:
+ return GetShortcutName(SHORTCUT_CHROME);
+ default:
+ NOTREACHED();
+ return string16();
+ }
}
string16 BrowserDistribution::GetBaseAppId() {
@@ -232,10 +256,19 @@ string16 BrowserDistribution::GetIconFilename() {
return string16();
grt (UTC plus 2) 2013/07/05 17:27:37 how do icons work for Chromium builds?
calamity 2013/07/16 04:05:17 I'm not sure. Does anybody else know?
grt (UTC plus 2) 2013/07/16 19:38:44 I just installed Chromium r211796, and the uninsta
grt (UTC plus 2) 2013/07/18 17:43:43 ping
}
-int BrowserDistribution::GetIconIndex() {
- // Assuming that main icon appears first alphabetically in the resource file
- // for GetIconFilename().
- return 0;
+int BrowserDistribution::GetIconIndex(ShortcutType shortcut_type) {
grt (UTC plus 2) 2013/07/05 17:27:37 move this up so that it immediately follows GetSho
calamity 2013/07/16 04:05:17 Done.
+ switch (shortcut_type) {
grt (UTC plus 2) 2013/07/05 17:27:37 as elsewhere: if (shortcut_type == SHORTCUT_APP_
calamity 2013/07/16 04:05:17 Done.
+ case SHORTCUT_CHROME:
+ case SHORTCUT_ALTERNATE_CHROME:
+ // Assuming that main icon appears first alphabetically in the resource
+ // file for GetIconFilename().
+ return 0;
+ case SHORTCUT_APP_LAUNCHER:
+ return 1;
+ default:
+ NOTREACHED();
+ return 0;
+ }
}
bool BrowserDistribution::GetChromeChannel(string16* channel) {

Powered by Google App Engine
This is Rietveld 408576698