OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/setup/chrome_frame_quick_enable.h" | 5 #include "chrome/installer/setup/chrome_frame_quick_enable.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
12 #include "base/win/registry.h" | 12 #include "base/win/registry.h" |
13 #include "chrome/installer/setup/install_worker.h" | 13 #include "chrome/installer/setup/install_worker.h" |
14 #include "chrome/installer/util/google_update_constants.h" | 14 #include "chrome/installer/util/google_update_constants.h" |
| 15 #include "chrome/installer/util/google_update_settings.h" |
15 #include "chrome/installer/util/install_util.h" | 16 #include "chrome/installer/util/install_util.h" |
16 #include "chrome/installer/util/installation_state.h" | 17 #include "chrome/installer/util/installation_state.h" |
17 #include "chrome/installer/util/installer_state.h" | 18 #include "chrome/installer/util/installer_state.h" |
18 #include "chrome/installer/util/product.h" | 19 #include "chrome/installer/util/product.h" |
19 #include "chrome/installer/util/work_item.h" | 20 #include "chrome/installer/util/work_item.h" |
20 #include "chrome/installer/util/work_item_list.h" | 21 #include "chrome/installer/util/work_item_list.h" |
21 | 22 |
22 #include "installer_util_strings.h" // NOLINT | 23 #include "installer_util_strings.h" // NOLINT |
23 | 24 |
24 using base::win::RegKey; | 25 using base::win::RegKey; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 if (!item_list->Do()) { | 133 if (!item_list->Do()) { |
133 item_list->Rollback(); | 134 item_list->Rollback(); |
134 status = INSTALL_FAILED; | 135 status = INSTALL_FAILED; |
135 } else { | 136 } else { |
136 DCHECK_EQ(FIRST_INSTALL_SUCCESS, status); | 137 DCHECK_EQ(FIRST_INSTALL_SUCCESS, status); |
137 VLOG(1) << "Chrome Frame successfully activated."; | 138 VLOG(1) << "Chrome Frame successfully activated."; |
138 } | 139 } |
139 } | 140 } |
140 } | 141 } |
141 | 142 |
| 143 // If quick-enable succeeded, check to see if the EULA has not yet been |
| 144 // accepted for the binaries. If this is the case, we must also flip the |
| 145 // eulaaccepted bit for them. Otherwise, Google Update would not update |
| 146 // Chrome Frame, and that would be bad. Don't flip the EULA bit for Chrome |
| 147 // itself, as it will show the EULA on first-run and mark its acceptance |
| 148 // accordingly. |
| 149 if (!InstallUtil::GetInstallReturnCode(status)) { |
| 150 const bool system_level = installer_state->system_install(); |
| 151 const ProductState* binaries = |
| 152 machine_state.GetProductState(system_level, |
| 153 BrowserDistribution::CHROME_BINARIES); |
| 154 DCHECK(binaries); |
| 155 DWORD eula_accepted; |
| 156 |
| 157 if (binaries != NULL && |
| 158 binaries->GetEulaAccepted(&eula_accepted) && |
| 159 eula_accepted == 0 && |
| 160 !GoogleUpdateSettings::SetEULAConsent( |
| 161 machine_state, |
| 162 BrowserDistribution::GetSpecificDistribution( |
| 163 BrowserDistribution::CHROME_BINARIES), |
| 164 true)) { |
| 165 LOG(ERROR) << "Failed to set EULA consent for multi-install binaries."; |
| 166 } |
| 167 } |
| 168 |
142 return status; | 169 return status; |
143 } | 170 } |
144 | 171 |
145 } // namespace installer | 172 } // namespace installer |
OLD | NEW |