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 #include "chrome/installer/util/channel_info.h" | 5 #include "chrome/installer/util/channel_info.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/win/registry.h" | 8 #include "base/win/registry.h" |
9 #include "chrome/installer/util/google_update_constants.h" | 9 #include "chrome/installer/util/google_update_constants.h" |
10 #include "chrome/installer/util/util_constants.h" | 10 #include "chrome/installer/util/util_constants.h" |
11 | 11 |
12 using base::win::RegKey; | 12 using base::win::RegKey; |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 const wchar_t kModChrome[] = L"-chrome"; | 16 const wchar_t kModChrome[] = L"-chrome"; |
17 const wchar_t kModChromeFrame[] = L"-chromeframe"; | 17 const wchar_t kModChromeFrame[] = L"-chromeframe"; |
18 const wchar_t kModAppHost[] = L"-apphost"; | 18 const wchar_t kModAppHost[] = L"-apphost"; |
| 19 const wchar_t kModAppLauncher[] = L"-applauncher"; |
19 const wchar_t kModMultiInstall[] = L"-multi"; | 20 const wchar_t kModMultiInstall[] = L"-multi"; |
20 const wchar_t kModReadyMode[] = L"-readymode"; | 21 const wchar_t kModReadyMode[] = L"-readymode"; |
21 const wchar_t kModStage[] = L"-stage:"; | 22 const wchar_t kModStage[] = L"-stage:"; |
22 const wchar_t kSfxFull[] = L"-full"; | 23 const wchar_t kSfxFull[] = L"-full"; |
23 const wchar_t kSfxMultiFail[] = L"-multifail"; | 24 const wchar_t kSfxMultiFail[] = L"-multifail"; |
24 | 25 |
25 const wchar_t* const kChannels[] = { | 26 const wchar_t* const kChannels[] = { |
26 installer::kChromeChannelBeta, | 27 installer::kChromeChannelBeta, |
27 installer::kChromeChannelDev | 28 installer::kChromeChannelDev |
28 }; | 29 }; |
29 | 30 |
30 const wchar_t* const kModifiers[] = { | 31 const wchar_t* const kModifiers[] = { |
31 kModStage, | 32 kModStage, |
32 kModMultiInstall, | 33 kModMultiInstall, |
33 kModChrome, | 34 kModChrome, |
34 kModChromeFrame, | 35 kModChromeFrame, |
35 kModAppHost, | 36 kModAppHost, |
| 37 kModAppLauncher, |
36 kModReadyMode, | 38 kModReadyMode, |
37 kSfxMultiFail, | 39 kSfxMultiFail, |
38 kSfxFull | 40 kSfxFull |
39 }; | 41 }; |
40 | 42 |
41 enum ModifierIndex { | 43 enum ModifierIndex { |
42 MOD_STAGE, | 44 MOD_STAGE, |
43 MOD_MULTI_INSTALL, | 45 MOD_MULTI_INSTALL, |
44 MOD_CHROME, | 46 MOD_CHROME, |
45 MOD_CHROME_FRAME, | 47 MOD_CHROME_FRAME, |
46 MOD_APP_HOST, | 48 MOD_APP_HOST, |
| 49 MOD_APP_LAUNCHER, |
47 MOD_READY_MODE, | 50 MOD_READY_MODE, |
48 SFX_MULTI_FAIL, | 51 SFX_MULTI_FAIL, |
49 SFX_FULL, | 52 SFX_FULL, |
50 NUM_MODIFIERS | 53 NUM_MODIFIERS |
51 }; | 54 }; |
52 | 55 |
53 COMPILE_ASSERT(NUM_MODIFIERS == arraysize(kModifiers), | 56 COMPILE_ASSERT(NUM_MODIFIERS == arraysize(kModifiers), |
54 kModifiers_disagrees_with_ModifierIndex_comma_they_must_match_bang); | 57 kModifiers_disagrees_with_ModifierIndex_comma_they_must_match_bang); |
55 | 58 |
56 // Returns true if the modifier is found, in which case |position| holds the | 59 // Returns true if the modifier is found, in which case |position| holds the |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 } | 200 } |
198 | 201 |
199 bool ChannelInfo::IsAppHost() const { | 202 bool ChannelInfo::IsAppHost() const { |
200 return HasModifier(MOD_APP_HOST, value_); | 203 return HasModifier(MOD_APP_HOST, value_); |
201 } | 204 } |
202 | 205 |
203 bool ChannelInfo::SetAppHost(bool value) { | 206 bool ChannelInfo::SetAppHost(bool value) { |
204 return SetModifier(MOD_APP_HOST, value, &value_); | 207 return SetModifier(MOD_APP_HOST, value, &value_); |
205 } | 208 } |
206 | 209 |
| 210 bool ChannelInfo::IsAppLauncher() const { |
| 211 return HasModifier(MOD_APP_LAUNCHER, value_); |
| 212 } |
| 213 |
| 214 bool ChannelInfo::SetAppLauncher(bool value) { |
| 215 return SetModifier(MOD_APP_LAUNCHER, value, &value_); |
| 216 } |
| 217 |
207 bool ChannelInfo::IsMultiInstall() const { | 218 bool ChannelInfo::IsMultiInstall() const { |
208 return HasModifier(MOD_MULTI_INSTALL, value_); | 219 return HasModifier(MOD_MULTI_INSTALL, value_); |
209 } | 220 } |
210 | 221 |
211 bool ChannelInfo::SetMultiInstall(bool value) { | 222 bool ChannelInfo::SetMultiInstall(bool value) { |
212 return SetModifier(MOD_MULTI_INSTALL, value, &value_); | 223 return SetModifier(MOD_MULTI_INSTALL, value, &value_); |
213 } | 224 } |
214 | 225 |
215 bool ChannelInfo::IsReadyMode() const { | 226 bool ChannelInfo::IsReadyMode() const { |
216 return HasModifier(MOD_READY_MODE, value_); | 227 return HasModifier(MOD_READY_MODE, value_); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 | 279 |
269 bool ChannelInfo::HasMultiFailSuffix() const { | 280 bool ChannelInfo::HasMultiFailSuffix() const { |
270 return HasModifier(SFX_MULTI_FAIL, value_); | 281 return HasModifier(SFX_MULTI_FAIL, value_); |
271 } | 282 } |
272 | 283 |
273 bool ChannelInfo::SetMultiFailSuffix(bool value) { | 284 bool ChannelInfo::SetMultiFailSuffix(bool value) { |
274 return SetModifier(SFX_MULTI_FAIL, value, &value_); | 285 return SetModifier(SFX_MULTI_FAIL, value, &value_); |
275 } | 286 } |
276 | 287 |
277 } // namespace installer | 288 } // namespace installer |
OLD | NEW |