Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(537)

Side by Side Diff: chrome/installer/util/channel_info.cc

Issue 811283002: [Installer] Cleaning up dead code for App Launcher / App Host installs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 // TODO(huangs): Remove by M27.
19 const wchar_t kModAppHostDeprecated[] = L"-apphost";
grt (UTC plus 2) 2014/12/18 19:27:37 we're still getting update checks containing -apph
huangs 2015/01/05 06:01:12 Updated, with refactoring to ChannelInfo: - Replac
20 const wchar_t kModAppLauncher[] = L"-applauncher";
21 const wchar_t kModMultiInstall[] = L"-multi"; 18 const wchar_t kModMultiInstall[] = L"-multi";
22 const wchar_t kModReadyMode[] = L"-readymode"; 19 const wchar_t kModReadyMode[] = L"-readymode";
23 const wchar_t kModStage[] = L"-stage:"; 20 const wchar_t kModStage[] = L"-stage:";
24 const wchar_t kSfxFull[] = L"-full"; 21 const wchar_t kSfxFull[] = L"-full";
25 const wchar_t kSfxMigrating[] = L"-migrating"; 22 const wchar_t kSfxMigrating[] = L"-migrating";
26 const wchar_t kSfxMultiFail[] = L"-multifail"; 23 const wchar_t kSfxMultiFail[] = L"-multifail";
27 24
28 const wchar_t* const kChannels[] = { 25 const wchar_t* const kChannels[] = {
29 installer::kChromeChannelBeta, 26 installer::kChromeChannelBeta,
30 installer::kChromeChannelDev, 27 installer::kChromeChannelDev,
31 installer::kChromeChannelStableExplicit 28 installer::kChromeChannelStableExplicit
32 }; 29 };
33 30
34 const wchar_t* const kModifiers[] = { 31 const wchar_t* const kModifiers[] = {
35 kModStage, 32 kModStage,
36 kModMultiInstall, 33 kModMultiInstall,
37 kModChrome, 34 kModChrome,
38 kModChromeFrame, 35 kModChromeFrame,
39 kModAppHostDeprecated, // TODO(huangs): Remove by M27.
40 kModAppLauncher,
41 kModReadyMode, 36 kModReadyMode,
42 kSfxMultiFail, 37 kSfxMultiFail,
43 kSfxMigrating, 38 kSfxMigrating,
44 kSfxFull, 39 kSfxFull,
45 }; 40 };
46 41
47 enum ModifierIndex { 42 enum ModifierIndex {
48 MOD_STAGE, 43 MOD_STAGE,
49 MOD_MULTI_INSTALL, 44 MOD_MULTI_INSTALL,
50 MOD_CHROME, 45 MOD_CHROME,
51 MOD_CHROME_FRAME, 46 MOD_CHROME_FRAME,
52 MOD_APP_HOST_DEPRECATED, // TODO(huangs): Remove by M27.
53 MOD_APP_LAUNCHER,
54 MOD_READY_MODE, 47 MOD_READY_MODE,
55 SFX_MULTI_FAIL, 48 SFX_MULTI_FAIL,
56 SFX_MIGRATING, 49 SFX_MIGRATING,
57 SFX_FULL, 50 SFX_FULL,
58 NUM_MODIFIERS 51 NUM_MODIFIERS
59 }; 52 };
60 53
61 COMPILE_ASSERT(NUM_MODIFIERS == arraysize(kModifiers), 54 COMPILE_ASSERT(NUM_MODIFIERS == arraysize(kModifiers),
62 kModifiers_disagrees_with_ModifierIndex_comma_they_must_match_bang); 55 kModifiers_disagrees_with_ModifierIndex_comma_they_must_match_bang);
63 56
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 } 194 }
202 195
203 bool ChannelInfo::IsChromeFrame() const { 196 bool ChannelInfo::IsChromeFrame() const {
204 return HasModifier(MOD_CHROME_FRAME, value_); 197 return HasModifier(MOD_CHROME_FRAME, value_);
205 } 198 }
206 199
207 bool ChannelInfo::SetChromeFrame(bool value) { 200 bool ChannelInfo::SetChromeFrame(bool value) {
208 return SetModifier(MOD_CHROME_FRAME, value, &value_); 201 return SetModifier(MOD_CHROME_FRAME, value, &value_);
209 } 202 }
210 203
211 bool ChannelInfo::IsAppLauncher() const {
212 return HasModifier(MOD_APP_LAUNCHER, value_);
213 }
214
215 bool ChannelInfo::SetAppLauncher(bool value) {
216 // Unconditionally remove -apphost since it has been deprecated.
217 bool changed_app_host = SetModifier(MOD_APP_HOST_DEPRECATED, false, &value_);
218 bool changed_app_launcher = SetModifier(MOD_APP_LAUNCHER, value, &value_);
219 return changed_app_host || changed_app_launcher;
220 }
221
222 bool ChannelInfo::IsMultiInstall() const { 204 bool ChannelInfo::IsMultiInstall() const {
223 return HasModifier(MOD_MULTI_INSTALL, value_); 205 return HasModifier(MOD_MULTI_INSTALL, value_);
224 } 206 }
225 207
226 bool ChannelInfo::SetMultiInstall(bool value) { 208 bool ChannelInfo::SetMultiInstall(bool value) {
227 return SetModifier(MOD_MULTI_INSTALL, value, &value_); 209 return SetModifier(MOD_MULTI_INSTALL, value, &value_);
228 } 210 }
229 211
230 bool ChannelInfo::IsReadyMode() const { 212 bool ChannelInfo::IsReadyMode() const {
231 return HasModifier(MOD_READY_MODE, value_); 213 return HasModifier(MOD_READY_MODE, value_);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 284
303 for (int scan = 0; scan < NUM_MODIFIERS; ++scan) { 285 for (int scan = 0; scan < NUM_MODIFIERS; ++scan) {
304 ModifierIndex index = static_cast<ModifierIndex>(scan); 286 ModifierIndex index = static_cast<ModifierIndex>(scan);
305 modified = SetModifier(index, false, &value_) || modified; 287 modified = SetModifier(index, false, &value_) || modified;
306 } 288 }
307 289
308 return modified; 290 return modified;
309 } 291 }
310 292
311 } // namespace installer 293 } // namespace installer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698