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

Side by Side 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: 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 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 a class that contains various method related to branding. 5 // This file defines a class that contains various method related to branding.
6 // It provides only default implementations of these methods. Usually to add 6 // It provides only default implementations of these methods. Usually to add
7 // specific branding, we will need to extend this class with a custom 7 // specific branding, we will need to extend this class with a custom
8 // implementation. 8 // implementation.
9 9
10 #include "chrome/installer/util/browser_distribution.h" 10 #include "chrome/installer/util/browser_distribution.h"
(...skipping 21 matching lines...) Expand all
32 using installer::MasterPreferences; 32 using installer::MasterPreferences;
33 33
34 namespace { 34 namespace {
35 35
36 const wchar_t kChromiumActiveSetupGuid[] = 36 const wchar_t kChromiumActiveSetupGuid[] =
37 L"{7D2B3E1D-D096-4594-9D8F-A6667F12E0AC}"; 37 L"{7D2B3E1D-D096-4594-9D8F-A6667F12E0AC}";
38 38
39 const wchar_t kCommandExecuteImplUuid[] = 39 const wchar_t kCommandExecuteImplUuid[] =
40 L"{A2DF06F9-A21A-44A8-8A99-8B9C84F29160}"; 40 L"{A2DF06F9-A21A-44A8-8A99-8B9C84F29160}";
41 41
42 // The Chromium App Launcher icon is index 1; see chrome_exe.rc.
43 const int kAppLauncherIconIndex = 1;
44
42 // The BrowserDistribution objects are never freed. 45 // The BrowserDistribution objects are never freed.
43 BrowserDistribution* g_browser_distribution = NULL; 46 BrowserDistribution* g_browser_distribution = NULL;
44 BrowserDistribution* g_chrome_frame_distribution = NULL; 47 BrowserDistribution* g_chrome_frame_distribution = NULL;
45 BrowserDistribution* g_binaries_distribution = NULL; 48 BrowserDistribution* g_binaries_distribution = NULL;
46 BrowserDistribution* g_chrome_app_host_distribution = NULL; 49 BrowserDistribution* g_chrome_app_host_distribution = NULL;
47 50
48 // Returns true if currently running in npchrome_frame.dll 51 // Returns true if currently running in npchrome_frame.dll
49 bool IsChromeFrameModule() { 52 bool IsChromeFrameModule() {
50 base::FilePath module_path; 53 base::FilePath module_path;
51 PathService::Get(base::FILE_MODULE, &module_path); 54 PathService::Get(base::FILE_MODULE, &module_path);
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 } 150 }
148 151
149 string16 BrowserDistribution::GetAppGuid() { 152 string16 BrowserDistribution::GetAppGuid() {
150 return L""; 153 return L"";
151 } 154 }
152 155
153 string16 BrowserDistribution::GetBaseAppName() { 156 string16 BrowserDistribution::GetBaseAppName() {
154 return L"Chromium"; 157 return L"Chromium";
155 } 158 }
156 159
157 string16 BrowserDistribution::GetAppShortCutName() { 160 string16 BrowserDistribution::GetDisplayName() {
158 return GetBaseAppName(); 161 return GetShortcutName(SHORTCUT_CHROME);
159 } 162 }
160 163
161 string16 BrowserDistribution::GetAlternateApplicationName() { 164 string16 BrowserDistribution::GetShortcutName(ShortcutType shortcut_type) {
162 return L"The Internet"; 165 switch (shortcut_type) {
166 case SHORTCUT_CHROME_ALTERNATE:
167 // TODO(calamity): Change IDS_OEM_MAIN_SHORTCUT_NAME in
168 // chromium_strings.grd to "The Internet" (so that it doesn't collide with
169 // the value in google_chrome_strings.grd) then change this to
170 // installer::GetLocalizedString(IDS_OEM_MAIN_SHORTCUT_NAME_BASE)
171 return L"The Internet";
172 case SHORTCUT_APP_LAUNCHER:
173 return installer::GetLocalizedString(IDS_APP_LIST_SHORTCUT_NAME_BASE);
174 default:
175 DCHECK_EQ(shortcut_type, SHORTCUT_CHROME);
176 return GetBaseAppName();
177 }
178 }
179
180 int BrowserDistribution::GetIconIndex(ShortcutType shortcut_type) {
181 if (shortcut_type == SHORTCUT_APP_LAUNCHER)
182 return kAppLauncherIconIndex;
183 DCHECK(shortcut_type == SHORTCUT_CHROME ||
184 shortcut_type == SHORTCUT_CHROME_ALTERNATE) << shortcut_type;
185 return 0;
186 }
187
188 string16 BrowserDistribution::GetIconFilename() {
189 return installer::kChromeExe;
190 }
191
192 string16 BrowserDistribution::GetStartMenuShortcutSubfolder(
193 Subfolder subfolder_type) {
194 DCHECK_EQ(subfolder_type, SUBFOLDER_CHROME);
195 return GetShortcutName(SHORTCUT_CHROME);
163 } 196 }
164 197
165 string16 BrowserDistribution::GetBaseAppId() { 198 string16 BrowserDistribution::GetBaseAppId() {
166 return L"Chromium"; 199 return L"Chromium";
167 } 200 }
168 201
169 string16 BrowserDistribution::GetInstallSubDir() { 202 string16 BrowserDistribution::GetInstallSubDir() {
170 return L"Chromium"; 203 return L"Chromium";
171 } 204 }
172 205
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 } 254 }
222 255
223 bool BrowserDistribution::CanSetAsDefault() { 256 bool BrowserDistribution::CanSetAsDefault() {
224 return true; 257 return true;
225 } 258 }
226 259
227 bool BrowserDistribution::CanCreateDesktopShortcuts() { 260 bool BrowserDistribution::CanCreateDesktopShortcuts() {
228 return true; 261 return true;
229 } 262 }
230 263
231 string16 BrowserDistribution::GetIconFilename() {
232 return string16();
233 }
234
235 int BrowserDistribution::GetIconIndex() {
236 // Assuming that main icon appears first alphabetically in the resource file
237 // for GetIconFilename().
238 return 0;
239 }
240
241 bool BrowserDistribution::GetChromeChannel(string16* channel) { 264 bool BrowserDistribution::GetChromeChannel(string16* channel) {
242 return false; 265 return false;
243 } 266 }
244 267
245 bool BrowserDistribution::GetCommandExecuteImplClsid( 268 bool BrowserDistribution::GetCommandExecuteImplClsid(
246 string16* handler_class_uuid) { 269 string16* handler_class_uuid) {
247 if (handler_class_uuid) 270 if (handler_class_uuid)
248 *handler_class_uuid = kCommandExecuteImplUuid; 271 *handler_class_uuid = kCommandExecuteImplUuid;
249 return true; 272 return true;
250 } 273 }
251 274
252 bool BrowserDistribution::AppHostIsSupported() { 275 bool BrowserDistribution::AppHostIsSupported() {
253 return false; 276 return false;
254 } 277 }
255 278
256 void BrowserDistribution::UpdateInstallStatus(bool system_install, 279 void BrowserDistribution::UpdateInstallStatus(bool system_install,
257 installer::ArchiveType archive_type, 280 installer::ArchiveType archive_type,
258 installer::InstallStatus install_status) { 281 installer::InstallStatus install_status) {
259 } 282 }
260 283
261 bool BrowserDistribution::ShouldSetExperimentLabels() { 284 bool BrowserDistribution::ShouldSetExperimentLabels() {
262 return false; 285 return false;
263 } 286 }
264 287
265 bool BrowserDistribution::HasUserExperiments() { 288 bool BrowserDistribution::HasUserExperiments() {
266 return false; 289 return false;
267 } 290 }
OLDNEW
« no previous file with comments | « chrome/installer/util/browser_distribution.h ('k') | chrome/installer/util/chrome_app_host_distribution.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698