OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 specific implementation of BrowserDistribution class for | 5 // This file defines a specific implementation of BrowserDistribution class for |
6 // Chrome Frame. It overrides the bare minimum of methods necessary to get a | 6 // Chrome Frame. It overrides the bare minimum of methods necessary to get a |
7 // Chrome Frame installer that does not interact with Google Chrome or | 7 // Chrome Frame installer that does not interact with Google Chrome or |
8 // Chromium installations. | 8 // Chromium installations. |
9 | 9 |
10 #include "chrome/installer/util/chrome_frame_distribution.h" | 10 #include "chrome/installer/util/chrome_frame_distribution.h" |
11 | 11 |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
15 #include "chrome/installer/util/google_update_constants.h" | 15 #include "chrome/installer/util/google_update_constants.h" |
16 #include "chrome/installer/util/google_update_settings.h" | 16 #include "chrome/installer/util/google_update_settings.h" |
17 #include "chrome/installer/util/helper.h" | |
17 #include "chrome/installer/util/install_util.h" | 18 #include "chrome/installer/util/install_util.h" |
18 #include "chrome/installer/util/l10n_string_util.h" | 19 #include "chrome/installer/util/l10n_string_util.h" |
19 #include "chrome/installer/util/master_preferences.h" | 20 #include "chrome/installer/util/master_preferences.h" |
20 #include "chrome/installer/util/master_preferences_constants.h" | 21 #include "chrome/installer/util/master_preferences_constants.h" |
21 | 22 |
22 #include "installer_util_strings.h" // NOLINT | 23 #include "installer_util_strings.h" // NOLINT |
23 | 24 |
24 namespace { | 25 namespace { |
25 const wchar_t kChromeFrameGuid[] = L"{8BA986DA-5100-405E-AA35-86F34A02ACBF}"; | 26 const wchar_t kChromeFrameGuid[] = L"{8BA986DA-5100-405E-AA35-86F34A02ACBF}"; |
26 } | 27 } |
27 | 28 |
28 ChromeFrameDistribution::ChromeFrameDistribution( | 29 ChromeFrameDistribution::ChromeFrameDistribution( |
29 const installer::MasterPreferences& prefs) | 30 const installer::MasterPreferences& prefs) |
30 : BrowserDistribution(prefs), ceee_(prefs.install_ceee()), | 31 : BrowserDistribution(prefs), ceee_(prefs.install_ceee()), |
31 ready_mode_(false) { | 32 ready_mode_(false) { |
32 type_ = BrowserDistribution::CHROME_FRAME; | 33 type_ = BrowserDistribution::CHROME_FRAME; |
33 prefs.GetBool(installer::master_preferences::kChromeFrameReadyMode, | 34 prefs.GetBool(installer::master_preferences::kChromeFrameReadyMode, |
34 &ready_mode_); | 35 &ready_mode_); |
36 | |
37 bool system_install = false; | |
38 prefs.GetBool(installer::master_preferences::kSystemLevel, &system_install); | |
39 | |
40 // See if Chrome Frame is already installed. If so, we must make sure that | |
41 // the ceee and ready mode flags match. | |
42 CommandLine uninstall(CommandLine::NO_PROGRAM); | |
43 if (installer::GetUninstallSwitches(system_install, this, &uninstall)) { | |
44 if (!ceee_) { | |
45 LOG(INFO) << "CEEE is not specified on the command line but CEEE is " | |
grt (UTC plus 2)
2010/12/29 16:51:50
This log message says that CEEE is already install
tommi (sloooow) - chröme
2010/12/29 17:30:09
Thanks for catching this. Must have happened when
| |
46 "already installed. Implicitly enabling CEEE."; | |
47 ceee_ = uninstall.HasSwitch(installer::switches::kCeee); | |
48 } | |
49 | |
50 // If the user has already opted in to CF, we shouldn't set the ready-mode | |
51 // flag. If we don't do this, we might have two entries in the Add/Remove | |
52 // Programs list that can uninstall GCF. Also, we can only enable | |
53 // ready-mode if Chrome is also being installed. Without it, there's no way | |
54 // to uninstall Chrome Frame. | |
55 if (ready_mode_) { | |
56 if (!uninstall.HasSwitch(installer::switches::kChromeFrameReadyMode)) { | |
57 LOG(INFO) << "Ready mode was specified on the command line but GCF " | |
58 "is already fully installed. Ignoring command line."; | |
59 ready_mode_ = false; | |
60 } else if (!prefs.install_chrome()) { | |
61 LOG(WARNING) << "Cannot enable ready mode without installing Chrome."; | |
62 ready_mode_ = false; | |
63 } | |
64 } | |
65 } | |
35 } | 66 } |
36 | 67 |
37 std::wstring ChromeFrameDistribution::GetAppGuid() { | 68 std::wstring ChromeFrameDistribution::GetAppGuid() { |
38 return kChromeFrameGuid; | 69 return kChromeFrameGuid; |
39 } | 70 } |
40 | 71 |
41 std::wstring ChromeFrameDistribution::GetApplicationName() { | 72 std::wstring ChromeFrameDistribution::GetApplicationName() { |
42 const std::wstring& product_name = | 73 const std::wstring& product_name = |
43 installer::GetLocalizedString(IDS_PRODUCT_FRAME_NAME_BASE); | 74 installer::GetLocalizedString(IDS_PRODUCT_FRAME_NAME_BASE); |
44 return product_name; | 75 return product_name; |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
147 | 178 |
148 if (ready_mode_) | 179 if (ready_mode_) |
149 cmd_line->AppendSwitch(installer::switches::kChromeFrameReadyMode); | 180 cmd_line->AppendSwitch(installer::switches::kChromeFrameReadyMode); |
150 } | 181 } |
151 | 182 |
152 bool ChromeFrameDistribution::ShouldCreateUninstallEntry() { | 183 bool ChromeFrameDistribution::ShouldCreateUninstallEntry() { |
153 // If Chrome Frame is being installed in ready mode, then we will not | 184 // If Chrome Frame is being installed in ready mode, then we will not |
154 // add an entry to the add/remove dialog. | 185 // add an entry to the add/remove dialog. |
155 return !ready_mode_; | 186 return !ready_mode_; |
156 } | 187 } |
OLD | NEW |