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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
59 static BrowserDistribution::Type type = | 59 static BrowserDistribution::Type type = |
60 (MasterPreferences::ForCurrentProcess().install_chrome_frame() || | 60 (MasterPreferences::ForCurrentProcess().install_chrome_frame() || |
61 IsChromeFrameModule()) ? | 61 IsChromeFrameModule()) ? |
62 BrowserDistribution::CHROME_FRAME : | 62 BrowserDistribution::CHROME_FRAME : |
63 BrowserDistribution::CHROME_BROWSER; | 63 BrowserDistribution::CHROME_BROWSER; |
64 return type; | 64 return type; |
65 } | 65 } |
66 | 66 |
67 } // end namespace | 67 } // end namespace |
68 | 68 |
69 const char* BrowserDistribution::kDefaultAlternateChromeShortcutName = | |
gab
2013/07/05 14:23:37
Actually, this probably belongs more at the bottom
grt (UTC plus 2)
2013/07/05 17:27:37
comment on comment: my gut tells me that static in
| |
70 "The Internet"; | |
71 | |
69 BrowserDistribution::BrowserDistribution() | 72 BrowserDistribution::BrowserDistribution() |
70 : type_(CHROME_BROWSER) { | 73 : type_(CHROME_BROWSER) { |
71 } | 74 } |
72 | 75 |
73 BrowserDistribution::BrowserDistribution(Type type) | 76 BrowserDistribution::BrowserDistribution(Type type) |
74 : type_(type) { | 77 : type_(type) { |
75 } | 78 } |
76 | 79 |
77 template<class DistributionClass> | 80 template<class DistributionClass> |
78 BrowserDistribution* BrowserDistribution::GetOrCreateBrowserDistribution( | 81 BrowserDistribution* BrowserDistribution::GetOrCreateBrowserDistribution( |
(...skipping 68 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) { |
grt (UTC plus 2)
2013/07/05 17:27:37
for all functions like this, make the NOTREACHED c
calamity
2013/07/16 04:05:17
Done. Any reason to use DCHECK_EQ instead of NOTRE
grt (UTC plus 2)
2013/07/16 19:38:44
DCHECK_EQ will show the value that shouldn't have
| |
166 case SHORTCUT_CHROME: | |
167 return GetBaseAppName(); | |
168 case SHORTCUT_ALTERNATE_CHROME: | |
169 return L"The Internet"; | |
170 case SHORTCUT_APP_LAUNCHER: | |
171 return L"Chromium App Launcher"; | |
172 default: | |
173 NOTREACHED(); | |
174 return string16(); | |
175 } | |
176 } | |
177 | |
178 string16 BrowserDistribution::GetStartMenuShortcutSubfolder( | |
179 Subfolder subfolder_type) { | |
180 switch (subfolder_type) { | |
grt (UTC plus 2)
2013/07/05 17:27:37
as above:
DCHECK_EQ(subfolder_type, SUBFOLDER_CH
calamity
2013/07/16 04:05:17
Done.
| |
181 case SUBFOLDER_CHROME: | |
182 return GetShortcutName(SHORTCUT_CHROME); | |
183 default: | |
184 NOTREACHED(); | |
185 return string16(); | |
186 } | |
163 } | 187 } |
164 | 188 |
165 string16 BrowserDistribution::GetBaseAppId() { | 189 string16 BrowserDistribution::GetBaseAppId() { |
166 return L"Chromium"; | 190 return L"Chromium"; |
167 } | 191 } |
168 | 192 |
169 string16 BrowserDistribution::GetInstallSubDir() { | 193 string16 BrowserDistribution::GetInstallSubDir() { |
170 return L"Chromium"; | 194 return L"Chromium"; |
171 } | 195 } |
172 | 196 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
221 } | 245 } |
222 | 246 |
223 bool BrowserDistribution::CanSetAsDefault() { | 247 bool BrowserDistribution::CanSetAsDefault() { |
224 return true; | 248 return true; |
225 } | 249 } |
226 | 250 |
227 bool BrowserDistribution::CanCreateDesktopShortcuts() { | 251 bool BrowserDistribution::CanCreateDesktopShortcuts() { |
228 return true; | 252 return true; |
229 } | 253 } |
230 | 254 |
231 string16 BrowserDistribution::GetIconFilename() { | 255 string16 BrowserDistribution::GetIconFilename() { |
grt (UTC plus 2)
2013/07/05 17:27:37
move this up so that it immediately precedes GetSt
calamity
2013/07/16 04:05:17
Done.
| |
232 return string16(); | 256 return string16(); |
grt (UTC plus 2)
2013/07/05 17:27:37
how do icons work for Chromium builds?
calamity
2013/07/16 04:05:17
I'm not sure. Does anybody else know?
grt (UTC plus 2)
2013/07/16 19:38:44
I just installed Chromium r211796, and the uninsta
grt (UTC plus 2)
2013/07/18 17:43:43
ping
| |
233 } | 257 } |
234 | 258 |
235 int BrowserDistribution::GetIconIndex() { | 259 int BrowserDistribution::GetIconIndex(ShortcutType shortcut_type) { |
grt (UTC plus 2)
2013/07/05 17:27:37
move this up so that it immediately follows GetSho
calamity
2013/07/16 04:05:17
Done.
| |
236 // Assuming that main icon appears first alphabetically in the resource file | 260 switch (shortcut_type) { |
grt (UTC plus 2)
2013/07/05 17:27:37
as elsewhere:
if (shortcut_type == SHORTCUT_APP_
calamity
2013/07/16 04:05:17
Done.
| |
237 // for GetIconFilename(). | 261 case SHORTCUT_CHROME: |
238 return 0; | 262 case SHORTCUT_ALTERNATE_CHROME: |
263 // Assuming that main icon appears first alphabetically in the resource | |
264 // file for GetIconFilename(). | |
265 return 0; | |
266 case SHORTCUT_APP_LAUNCHER: | |
267 return 1; | |
268 default: | |
269 NOTREACHED(); | |
270 return 0; | |
271 } | |
239 } | 272 } |
240 | 273 |
241 bool BrowserDistribution::GetChromeChannel(string16* channel) { | 274 bool BrowserDistribution::GetChromeChannel(string16* channel) { |
242 return false; | 275 return false; |
243 } | 276 } |
244 | 277 |
245 bool BrowserDistribution::GetCommandExecuteImplClsid( | 278 bool BrowserDistribution::GetCommandExecuteImplClsid( |
246 string16* handler_class_uuid) { | 279 string16* handler_class_uuid) { |
247 if (handler_class_uuid) | 280 if (handler_class_uuid) |
248 *handler_class_uuid = kCommandExecuteImplUuid; | 281 *handler_class_uuid = kCommandExecuteImplUuid; |
249 return true; | 282 return true; |
250 } | 283 } |
251 | 284 |
252 bool BrowserDistribution::AppHostIsSupported() { | 285 bool BrowserDistribution::AppHostIsSupported() { |
253 return false; | 286 return false; |
254 } | 287 } |
255 | 288 |
256 void BrowserDistribution::UpdateInstallStatus(bool system_install, | 289 void BrowserDistribution::UpdateInstallStatus(bool system_install, |
257 installer::ArchiveType archive_type, | 290 installer::ArchiveType archive_type, |
258 installer::InstallStatus install_status) { | 291 installer::InstallStatus install_status) { |
259 } | 292 } |
260 | 293 |
261 bool BrowserDistribution::ShouldSetExperimentLabels() { | 294 bool BrowserDistribution::ShouldSetExperimentLabels() { |
262 return false; | 295 return false; |
263 } | 296 } |
264 | 297 |
265 bool BrowserDistribution::HasUserExperiments() { | 298 bool BrowserDistribution::HasUserExperiments() { |
266 return false; | 299 return false; |
267 } | 300 } |
OLD | NEW |