OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 string16(); | |
190 } | |
191 | |
192 string16 BrowserDistribution::GetStartMenuShortcutSubfolder( | |
193 Subfolder subfolder_type) { | |
194 switch (subfolder_type) { | |
grt (UTC plus 2)
2013/07/16 19:38:44
remove this switch statement. the only two lines n
calamity
2013/07/18 07:56:14
Done.
| |
195 case SUBFOLDER_CHROME: | |
196 return GetShortcutName(SHORTCUT_CHROME); | |
197 default: | |
198 DCHECK_EQ(subfolder_type, SUBFOLDER_CHROME); | |
199 return GetShortcutName(SHORTCUT_CHROME); | |
200 } | |
163 } | 201 } |
164 | 202 |
165 string16 BrowserDistribution::GetBaseAppId() { | 203 string16 BrowserDistribution::GetBaseAppId() { |
166 return L"Chromium"; | 204 return L"Chromium"; |
167 } | 205 } |
168 | 206 |
169 string16 BrowserDistribution::GetInstallSubDir() { | 207 string16 BrowserDistribution::GetInstallSubDir() { |
170 return L"Chromium"; | 208 return L"Chromium"; |
171 } | 209 } |
172 | 210 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
221 } | 259 } |
222 | 260 |
223 bool BrowserDistribution::CanSetAsDefault() { | 261 bool BrowserDistribution::CanSetAsDefault() { |
224 return true; | 262 return true; |
225 } | 263 } |
226 | 264 |
227 bool BrowserDistribution::CanCreateDesktopShortcuts() { | 265 bool BrowserDistribution::CanCreateDesktopShortcuts() { |
228 return true; | 266 return true; |
229 } | 267 } |
230 | 268 |
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) { | 269 bool BrowserDistribution::GetChromeChannel(string16* channel) { |
242 return false; | 270 return false; |
243 } | 271 } |
244 | 272 |
245 bool BrowserDistribution::GetCommandExecuteImplClsid( | 273 bool BrowserDistribution::GetCommandExecuteImplClsid( |
246 string16* handler_class_uuid) { | 274 string16* handler_class_uuid) { |
247 if (handler_class_uuid) | 275 if (handler_class_uuid) |
248 *handler_class_uuid = kCommandExecuteImplUuid; | 276 *handler_class_uuid = kCommandExecuteImplUuid; |
249 return true; | 277 return true; |
250 } | 278 } |
251 | 279 |
252 bool BrowserDistribution::AppHostIsSupported() { | 280 bool BrowserDistribution::AppHostIsSupported() { |
253 return false; | 281 return false; |
254 } | 282 } |
255 | 283 |
256 void BrowserDistribution::UpdateInstallStatus(bool system_install, | 284 void BrowserDistribution::UpdateInstallStatus(bool system_install, |
257 installer::ArchiveType archive_type, | 285 installer::ArchiveType archive_type, |
258 installer::InstallStatus install_status) { | 286 installer::InstallStatus install_status) { |
259 } | 287 } |
260 | 288 |
261 bool BrowserDistribution::ShouldSetExperimentLabels() { | 289 bool BrowserDistribution::ShouldSetExperimentLabels() { |
262 return false; | 290 return false; |
263 } | 291 } |
264 | 292 |
265 bool BrowserDistribution::HasUserExperiments() { | 293 bool BrowserDistribution::HasUserExperiments() { |
266 return false; | 294 return false; |
267 } | 295 } |
OLD | NEW |