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

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

Issue 11267023: Implementing --app-launcher install/uninstall flow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nits; added localized string for App Launcher uninstall shortcut. Created 8 years, 1 month 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 | Annotate | Revision Log
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 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
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
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
OLDNEW
« no previous file with comments | « chrome/installer/util/channel_info.h ('k') | chrome/installer/util/chrome_app_host_distribution.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698