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 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 20 matching lines...) Expand all Loading... |
31 | 31 |
32 #include "installer_util_strings.h" // NOLINT | 32 #include "installer_util_strings.h" // NOLINT |
33 | 33 |
34 namespace { | 34 namespace { |
35 | 35 |
36 const wchar_t kChromeGuid[] = L"{8A69D345-D564-463c-AFF1-A69D9E530F96}"; | 36 const wchar_t kChromeGuid[] = L"{8A69D345-D564-463c-AFF1-A69D9E530F96}"; |
37 const wchar_t kBrowserAppId[] = L"Chrome"; | 37 const wchar_t kBrowserAppId[] = L"Chrome"; |
38 const wchar_t kCommandExecuteImplUuid[] = | 38 const wchar_t kCommandExecuteImplUuid[] = |
39 L"{5C65F4B0-3651-4514-B207-D10CB699B14B}"; | 39 L"{5C65F4B0-3651-4514-B207-D10CB699B14B}"; |
40 | 40 |
| 41 // The Google Chrome App Launcher icon is index 5; see chrome_exe.rc. |
| 42 const int kAppLauncherIconIndex = 5; |
| 43 |
41 // Substitute the locale parameter in uninstall URL with whatever | 44 // Substitute the locale parameter in uninstall URL with whatever |
42 // Google Update tells us is the locale. In case we fail to find | 45 // Google Update tells us is the locale. In case we fail to find |
43 // the locale, we use US English. | 46 // the locale, we use US English. |
44 string16 LocalizeUrl(const wchar_t* url) { | 47 string16 LocalizeUrl(const wchar_t* url) { |
45 string16 language; | 48 string16 language; |
46 if (!GoogleUpdateSettings::GetLanguage(&language)) | 49 if (!GoogleUpdateSettings::GetLanguage(&language)) |
47 language = L"en-US"; // Default to US English. | 50 language = L"en-US"; // Default to US English. |
48 return ReplaceStringPlaceholders(url, language.c_str(), NULL); | 51 return ReplaceStringPlaceholders(url, language.c_str(), NULL); |
49 } | 52 } |
50 | 53 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 return product_guid(); | 121 return product_guid(); |
119 } | 122 } |
120 | 123 |
121 string16 GoogleChromeDistribution::GetBaseAppName() { | 124 string16 GoogleChromeDistribution::GetBaseAppName() { |
122 // I'd really like to return L ## PRODUCT_FULLNAME_STRING; but that's no good | 125 // 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 | 126 // since it'd be "Chromium" in a non-Chrome build, which isn't at all what I |
124 // want. Sigh. | 127 // want. Sigh. |
125 return L"Google Chrome"; | 128 return L"Google Chrome"; |
126 } | 129 } |
127 | 130 |
128 string16 GoogleChromeDistribution::GetAppShortCutName() { | 131 string16 GoogleChromeDistribution::GetShortcutName(ShortcutType shortcut_type) { |
129 const string16& app_shortcut_name = | 132 int string_id = IDS_PRODUCT_NAME_BASE; |
130 installer::GetLocalizedString(IDS_PRODUCT_NAME_BASE); | 133 switch (shortcut_type) { |
131 return app_shortcut_name; | 134 case SHORTCUT_CHROME_ALTERNATE: |
| 135 string_id = IDS_OEM_MAIN_SHORTCUT_NAME_BASE; |
| 136 break; |
| 137 case SHORTCUT_APP_LAUNCHER: |
| 138 string_id = IDS_APP_LIST_SHORTCUT_NAME_BASE; |
| 139 break; |
| 140 default: |
| 141 DCHECK_EQ(shortcut_type, SHORTCUT_CHROME); |
| 142 break; |
| 143 } |
| 144 return installer::GetLocalizedString(string_id); |
132 } | 145 } |
133 | 146 |
134 string16 GoogleChromeDistribution::GetAlternateApplicationName() { | 147 int GoogleChromeDistribution::GetIconIndex(ShortcutType shortcut_type) { |
135 const string16& alt_product_name = | 148 if (shortcut_type == SHORTCUT_APP_LAUNCHER) |
136 installer::GetLocalizedString(IDS_OEM_MAIN_SHORTCUT_NAME_BASE); | 149 return kAppLauncherIconIndex; |
137 return alt_product_name; | 150 DCHECK(shortcut_type == SHORTCUT_CHROME || |
| 151 shortcut_type == SHORTCUT_CHROME_ALTERNATE) << shortcut_type; |
| 152 return 0; |
138 } | 153 } |
139 | 154 |
140 string16 GoogleChromeDistribution::GetBaseAppId() { | 155 string16 GoogleChromeDistribution::GetBaseAppId() { |
141 return kBrowserAppId; | 156 return kBrowserAppId; |
142 } | 157 } |
143 | 158 |
144 string16 GoogleChromeDistribution::GetInstallSubDir() { | 159 string16 GoogleChromeDistribution::GetInstallSubDir() { |
145 string16 sub_dir(installer::kGoogleChromeInstallSubDir1); | 160 string16 sub_dir(installer::kGoogleChromeInstallSubDir1); |
146 sub_dir.append(L"\\"); | 161 sub_dir.append(L"\\"); |
147 sub_dir.append(installer::kGoogleChromeInstallSubDir2); | 162 sub_dir.append(installer::kGoogleChromeInstallSubDir2); |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 product_guid()); | 286 product_guid()); |
272 } | 287 } |
273 | 288 |
274 bool GoogleChromeDistribution::ShouldSetExperimentLabels() { | 289 bool GoogleChromeDistribution::ShouldSetExperimentLabels() { |
275 return true; | 290 return true; |
276 } | 291 } |
277 | 292 |
278 bool GoogleChromeDistribution::HasUserExperiments() { | 293 bool GoogleChromeDistribution::HasUserExperiments() { |
279 return true; | 294 return true; |
280 } | 295 } |
OLD | NEW |