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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 dist = GetOrCreateBrowserDistribution<ChromiumBinariesDistribution>( | 135 dist = GetOrCreateBrowserDistribution<ChromiumBinariesDistribution>( |
136 &g_binaries_distribution); | 136 &g_binaries_distribution); |
137 #endif | 137 #endif |
138 } | 138 } |
139 | 139 |
140 return dist; | 140 return dist; |
141 } | 141 } |
142 | 142 |
143 void BrowserDistribution::DoPostUninstallOperations( | 143 void BrowserDistribution::DoPostUninstallOperations( |
144 const Version& version, const base::FilePath& local_data_path, | 144 const Version& version, const base::FilePath& local_data_path, |
145 const string16& distribution_data) { | 145 const base::string16& distribution_data) { |
146 } | 146 } |
147 | 147 |
148 string16 BrowserDistribution::GetActiveSetupGuid() { | 148 base::string16 BrowserDistribution::GetActiveSetupGuid() { |
149 return kChromiumActiveSetupGuid; | 149 return kChromiumActiveSetupGuid; |
150 } | 150 } |
151 | 151 |
152 string16 BrowserDistribution::GetAppGuid() { | 152 base::string16 BrowserDistribution::GetAppGuid() { |
153 return L""; | 153 return L""; |
154 } | 154 } |
155 | 155 |
156 string16 BrowserDistribution::GetBaseAppName() { | 156 base::string16 BrowserDistribution::GetBaseAppName() { |
157 return L"Chromium"; | 157 return L"Chromium"; |
158 } | 158 } |
159 | 159 |
160 string16 BrowserDistribution::GetDisplayName() { | 160 base::string16 BrowserDistribution::GetDisplayName() { |
161 return GetShortcutName(SHORTCUT_CHROME); | 161 return GetShortcutName(SHORTCUT_CHROME); |
162 } | 162 } |
163 | 163 |
164 string16 BrowserDistribution::GetShortcutName(ShortcutType shortcut_type) { | 164 base::string16 BrowserDistribution::GetShortcutName( |
| 165 ShortcutType shortcut_type) { |
165 switch (shortcut_type) { | 166 switch (shortcut_type) { |
166 case SHORTCUT_CHROME_ALTERNATE: | 167 case SHORTCUT_CHROME_ALTERNATE: |
167 // TODO(calamity): Change IDS_OEM_MAIN_SHORTCUT_NAME in | 168 // TODO(calamity): Change IDS_OEM_MAIN_SHORTCUT_NAME in |
168 // chromium_strings.grd to "The Internet" (so that it doesn't collide with | 169 // 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 // the value in google_chrome_strings.grd) then change this to |
170 // installer::GetLocalizedString(IDS_OEM_MAIN_SHORTCUT_NAME_BASE) | 171 // installer::GetLocalizedString(IDS_OEM_MAIN_SHORTCUT_NAME_BASE) |
171 return L"The Internet"; | 172 return L"The Internet"; |
172 case SHORTCUT_APP_LAUNCHER: | 173 case SHORTCUT_APP_LAUNCHER: |
173 return installer::GetLocalizedString(IDS_APP_LIST_SHORTCUT_NAME_BASE); | 174 return installer::GetLocalizedString(IDS_APP_LIST_SHORTCUT_NAME_BASE); |
174 default: | 175 default: |
175 DCHECK_EQ(shortcut_type, SHORTCUT_CHROME); | 176 DCHECK_EQ(shortcut_type, SHORTCUT_CHROME); |
176 return GetBaseAppName(); | 177 return GetBaseAppName(); |
177 } | 178 } |
178 } | 179 } |
179 | 180 |
180 int BrowserDistribution::GetIconIndex(ShortcutType shortcut_type) { | 181 int BrowserDistribution::GetIconIndex(ShortcutType shortcut_type) { |
181 if (shortcut_type == SHORTCUT_APP_LAUNCHER) | 182 if (shortcut_type == SHORTCUT_APP_LAUNCHER) |
182 return kAppLauncherIconIndex; | 183 return kAppLauncherIconIndex; |
183 DCHECK(shortcut_type == SHORTCUT_CHROME || | 184 DCHECK(shortcut_type == SHORTCUT_CHROME || |
184 shortcut_type == SHORTCUT_CHROME_ALTERNATE) << shortcut_type; | 185 shortcut_type == SHORTCUT_CHROME_ALTERNATE) << shortcut_type; |
185 return 0; | 186 return 0; |
186 } | 187 } |
187 | 188 |
188 string16 BrowserDistribution::GetIconFilename() { | 189 base::string16 BrowserDistribution::GetIconFilename() { |
189 return installer::kChromeExe; | 190 return installer::kChromeExe; |
190 } | 191 } |
191 | 192 |
192 string16 BrowserDistribution::GetStartMenuShortcutSubfolder( | 193 base::string16 BrowserDistribution::GetStartMenuShortcutSubfolder( |
193 Subfolder subfolder_type) { | 194 Subfolder subfolder_type) { |
194 switch (subfolder_type) { | 195 switch (subfolder_type) { |
195 case SUBFOLDER_APPS: | 196 case SUBFOLDER_APPS: |
196 return installer::GetLocalizedString(IDS_APP_SHORTCUTS_SUBDIR_NAME_BASE); | 197 return installer::GetLocalizedString(IDS_APP_SHORTCUTS_SUBDIR_NAME_BASE); |
197 default: | 198 default: |
198 DCHECK_EQ(subfolder_type, SUBFOLDER_CHROME); | 199 DCHECK_EQ(subfolder_type, SUBFOLDER_CHROME); |
199 return GetShortcutName(SHORTCUT_CHROME); | 200 return GetShortcutName(SHORTCUT_CHROME); |
200 } | 201 } |
201 } | 202 } |
202 | 203 |
203 string16 BrowserDistribution::GetBaseAppId() { | 204 base::string16 BrowserDistribution::GetBaseAppId() { |
204 return L"Chromium"; | 205 return L"Chromium"; |
205 } | 206 } |
206 | 207 |
207 string16 BrowserDistribution::GetBrowserProgIdPrefix() { | 208 base::string16 BrowserDistribution::GetBrowserProgIdPrefix() { |
208 // This used to be "ChromiumHTML", but was forced to become "ChromiumHTM" | 209 // This used to be "ChromiumHTML", but was forced to become "ChromiumHTM" |
209 // because of http://crbug.com/153349. See the declaration of this function | 210 // because of http://crbug.com/153349. See the declaration of this function |
210 // in the header file for more details. | 211 // in the header file for more details. |
211 return L"ChromiumHTM"; | 212 return L"ChromiumHTM"; |
212 } | 213 } |
213 | 214 |
214 string16 BrowserDistribution::GetBrowserProgIdDesc() { | 215 base::string16 BrowserDistribution::GetBrowserProgIdDesc() { |
215 return L"Chromium HTML Document"; | 216 return L"Chromium HTML Document"; |
216 } | 217 } |
217 | 218 |
218 | 219 |
219 string16 BrowserDistribution::GetInstallSubDir() { | 220 base::string16 BrowserDistribution::GetInstallSubDir() { |
220 return L"Chromium"; | 221 return L"Chromium"; |
221 } | 222 } |
222 | 223 |
223 string16 BrowserDistribution::GetPublisherName() { | 224 base::string16 BrowserDistribution::GetPublisherName() { |
224 return L"Chromium"; | 225 return L"Chromium"; |
225 } | 226 } |
226 | 227 |
227 string16 BrowserDistribution::GetAppDescription() { | 228 base::string16 BrowserDistribution::GetAppDescription() { |
228 return L"Browse the web"; | 229 return L"Browse the web"; |
229 } | 230 } |
230 | 231 |
231 string16 BrowserDistribution::GetLongAppDescription() { | 232 base::string16 BrowserDistribution::GetLongAppDescription() { |
232 const string16& app_description = | 233 const base::string16& app_description = |
233 installer::GetLocalizedString(IDS_PRODUCT_DESCRIPTION_BASE); | 234 installer::GetLocalizedString(IDS_PRODUCT_DESCRIPTION_BASE); |
234 return app_description; | 235 return app_description; |
235 } | 236 } |
236 | 237 |
237 std::string BrowserDistribution::GetSafeBrowsingName() { | 238 std::string BrowserDistribution::GetSafeBrowsingName() { |
238 return "chromium"; | 239 return "chromium"; |
239 } | 240 } |
240 | 241 |
241 string16 BrowserDistribution::GetStateKey() { | 242 base::string16 BrowserDistribution::GetStateKey() { |
242 return L"Software\\Chromium"; | 243 return L"Software\\Chromium"; |
243 } | 244 } |
244 | 245 |
245 string16 BrowserDistribution::GetStateMediumKey() { | 246 base::string16 BrowserDistribution::GetStateMediumKey() { |
246 return L"Software\\Chromium"; | 247 return L"Software\\Chromium"; |
247 } | 248 } |
248 | 249 |
249 std::string BrowserDistribution::GetNetworkStatsServer() const { | 250 std::string BrowserDistribution::GetNetworkStatsServer() const { |
250 return ""; | 251 return ""; |
251 } | 252 } |
252 | 253 |
253 std::string BrowserDistribution::GetHttpPipeliningTestServer() const { | 254 std::string BrowserDistribution::GetHttpPipeliningTestServer() const { |
254 return ""; | 255 return ""; |
255 } | 256 } |
256 | 257 |
257 string16 BrowserDistribution::GetDistributionData(HKEY root_key) { | 258 base::string16 BrowserDistribution::GetDistributionData(HKEY root_key) { |
258 return L""; | 259 return L""; |
259 } | 260 } |
260 | 261 |
261 string16 BrowserDistribution::GetUninstallLinkName() { | 262 base::string16 BrowserDistribution::GetUninstallLinkName() { |
262 return L"Uninstall Chromium"; | 263 return L"Uninstall Chromium"; |
263 } | 264 } |
264 | 265 |
265 string16 BrowserDistribution::GetUninstallRegPath() { | 266 base::string16 BrowserDistribution::GetUninstallRegPath() { |
266 return L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Chromium"; | 267 return L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Chromium"; |
267 } | 268 } |
268 | 269 |
269 string16 BrowserDistribution::GetVersionKey() { | 270 base::string16 BrowserDistribution::GetVersionKey() { |
270 return L"Software\\Chromium"; | 271 return L"Software\\Chromium"; |
271 } | 272 } |
272 | 273 |
273 BrowserDistribution::DefaultBrowserControlPolicy | 274 BrowserDistribution::DefaultBrowserControlPolicy |
274 BrowserDistribution::GetDefaultBrowserControlPolicy() { | 275 BrowserDistribution::GetDefaultBrowserControlPolicy() { |
275 return DEFAULT_BROWSER_FULL_CONTROL; | 276 return DEFAULT_BROWSER_FULL_CONTROL; |
276 } | 277 } |
277 | 278 |
278 bool BrowserDistribution::CanCreateDesktopShortcuts() { | 279 bool BrowserDistribution::CanCreateDesktopShortcuts() { |
279 return true; | 280 return true; |
280 } | 281 } |
281 | 282 |
282 bool BrowserDistribution::GetChromeChannel(string16* channel) { | 283 bool BrowserDistribution::GetChromeChannel(base::string16* channel) { |
283 return false; | 284 return false; |
284 } | 285 } |
285 | 286 |
286 bool BrowserDistribution::GetCommandExecuteImplClsid( | 287 bool BrowserDistribution::GetCommandExecuteImplClsid( |
287 string16* handler_class_uuid) { | 288 base::string16* handler_class_uuid) { |
288 if (handler_class_uuid) | 289 if (handler_class_uuid) |
289 *handler_class_uuid = kCommandExecuteImplUuid; | 290 *handler_class_uuid = kCommandExecuteImplUuid; |
290 return true; | 291 return true; |
291 } | 292 } |
292 | 293 |
293 bool BrowserDistribution::AppHostIsSupported() { | 294 bool BrowserDistribution::AppHostIsSupported() { |
294 return false; | 295 return false; |
295 } | 296 } |
296 | 297 |
297 void BrowserDistribution::UpdateInstallStatus(bool system_install, | 298 void BrowserDistribution::UpdateInstallStatus(bool system_install, |
298 installer::ArchiveType archive_type, | 299 installer::ArchiveType archive_type, |
299 installer::InstallStatus install_status) { | 300 installer::InstallStatus install_status) { |
300 } | 301 } |
301 | 302 |
302 bool BrowserDistribution::ShouldSetExperimentLabels() { | 303 bool BrowserDistribution::ShouldSetExperimentLabels() { |
303 return false; | 304 return false; |
304 } | 305 } |
305 | 306 |
306 bool BrowserDistribution::HasUserExperiments() { | 307 bool BrowserDistribution::HasUserExperiments() { |
307 return false; | 308 return false; |
308 } | 309 } |
OLD | NEW |