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

Side by Side Diff: chrome/installer/util/google_chrome_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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // This file defines specific implementation of BrowserDistribution class for 5 // This file defines specific implementation of BrowserDistribution class for
6 // Google Chrome. 6 // Google Chrome.
7 7
8 #include "chrome/installer/util/google_chrome_distribution.h" 8 #include "chrome/installer/util/google_chrome_distribution.h"
9 9
10 #include <windows.h> 10 #include <windows.h>
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 return product_guid(); 118 return product_guid();
119 } 119 }
120 120
121 string16 GoogleChromeDistribution::GetBaseAppName() { 121 string16 GoogleChromeDistribution::GetBaseAppName() {
122 // I'd really like to return L ## PRODUCT_FULLNAME_STRING; but that's no good 122 // I'd really like to return L ## PRODUCT_FULLNAME_STRING; but that's no good
123 // since it'd be "Chromium" in a non-Chrome build, which isn't at all what I 123 // since it'd be "Chromium" in a non-Chrome build, which isn't at all what I
124 // want. Sigh. 124 // want. Sigh.
125 return L"Google Chrome"; 125 return L"Google Chrome";
126 } 126 }
127 127
128 string16 GoogleChromeDistribution::GetAppShortCutName() { 128 string16 GoogleChromeDistribution::GetShortcutName(ShortcutType shortcut_type) {
129 const string16& app_shortcut_name = 129 switch (shortcut_type) {
grt (UTC plus 2) 2013/07/05 17:27:37 int string_id = IDS_PRODUCT_NAME_BASE; switch (s
calamity 2013/07/16 04:05:17 Done.
130 installer::GetLocalizedString(IDS_PRODUCT_NAME_BASE); 130 case SHORTCUT_CHROME:
131 return app_shortcut_name; 131 return installer::GetLocalizedString(IDS_PRODUCT_NAME_BASE);
132 case SHORTCUT_ALTERNATE_CHROME:
133 return installer::GetLocalizedString(IDS_OEM_MAIN_SHORTCUT_NAME_BASE);
134 case SHORTCUT_APP_LAUNCHER:
135 // TODO(calamity): Replace with a localized string.
136 return L"Chrome App Launcher";
137 default:
138 NOTREACHED();
139 return string16();
140 }
132 } 141 }
133 142
134 string16 GoogleChromeDistribution::GetAlternateApplicationName() { 143 int GoogleChromeDistribution::GetIconIndex(ShortcutType shortcut_type) {
135 const string16& alt_product_name = 144 switch (shortcut_type) {
grt (UTC plus 2) 2013/07/05 17:27:37 if (shortcut_type == SHORTCUT_APP_LAUNCHER) re
calamity 2013/07/16 04:05:17 Done.
136 installer::GetLocalizedString(IDS_OEM_MAIN_SHORTCUT_NAME_BASE); 145 case SHORTCUT_CHROME:
137 return alt_product_name; 146 case SHORTCUT_ALTERNATE_CHROME:
147 return 0;
148 case SHORTCUT_APP_LAUNCHER:
149 return 6;
grt (UTC plus 2) 2013/07/05 17:27:37 Looks like this should be 5 according to chrome_ex
calamity 2013/07/16 04:05:17 Done.
150 default:
151 NOTREACHED();
152 return 0;
153 }
138 } 154 }
139 155
140 string16 GoogleChromeDistribution::GetBaseAppId() { 156 string16 GoogleChromeDistribution::GetBaseAppId() {
141 return kBrowserAppId; 157 return kBrowserAppId;
142 } 158 }
143 159
144 string16 GoogleChromeDistribution::GetInstallSubDir() { 160 string16 GoogleChromeDistribution::GetInstallSubDir() {
145 string16 sub_dir(installer::kGoogleChromeInstallSubDir1); 161 string16 sub_dir(installer::kGoogleChromeInstallSubDir1);
146 sub_dir.append(L"\\"); 162 sub_dir.append(L"\\");
147 sub_dir.append(installer::kGoogleChromeInstallSubDir2); 163 sub_dir.append(installer::kGoogleChromeInstallSubDir2);
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 product_guid()); 287 product_guid());
272 } 288 }
273 289
274 bool GoogleChromeDistribution::ShouldSetExperimentLabels() { 290 bool GoogleChromeDistribution::ShouldSetExperimentLabels() {
275 return true; 291 return true;
276 } 292 }
277 293
278 bool GoogleChromeDistribution::HasUserExperiments() { 294 bool GoogleChromeDistribution::HasUserExperiments() {
279 return true; 295 return true;
280 } 296 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698