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_ready_mode.h" | 5 #include "chrome/installer/setup/chrome_frame_ready_mode.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 208 |
209 // Replace the ChromeFrame user agent string in the registry, modify the | 209 // Replace the ChromeFrame user agent string in the registry, modify the |
210 // ReadyMode state flag. | 210 // ReadyMode state flag. |
211 const Version& installed_version = cf_state->version(); | 211 const Version& installed_version = cf_state->version(); |
212 | 212 |
213 scoped_ptr<WorkItemList> item_list(WorkItem::CreateWorkItemList()); | 213 scoped_ptr<WorkItemList> item_list(WorkItem::CreateWorkItemList()); |
214 | 214 |
215 HKEY root = installer_state.root_key(); | 215 HKEY root = installer_state.root_key(); |
216 | 216 |
217 std::wstring chrome_frame_ua_value_name(kChromeFramePrefix); | 217 std::wstring chrome_frame_ua_value_name(kChromeFramePrefix); |
218 chrome_frame_ua_value_name += | 218 chrome_frame_ua_value_name += ASCIIToWide(installed_version.GetString()); |
219 base::ASCIIToWide(installed_version.GetString()); | |
220 | 219 |
221 // Store the Chrome Frame user agent string | 220 // Store the Chrome Frame user agent string |
222 item_list->AddSetRegValueWorkItem(root, kPostPlatformUAKey, | 221 item_list->AddSetRegValueWorkItem(root, kPostPlatformUAKey, |
223 chrome_frame_ua_value_name, L"", true); | 222 chrome_frame_ua_value_name, L"", true); |
224 // Add a work item to update the Ready Mode state flag | 223 // Add a work item to update the Ready Mode state flag |
225 BrowserDistribution* dist = BrowserDistribution::GetSpecificDistribution( | 224 BrowserDistribution* dist = BrowserDistribution::GetSpecificDistribution( |
226 BrowserDistribution::CHROME_BINARIES); | 225 BrowserDistribution::CHROME_BINARIES); |
227 item_list->AddSetRegValueWorkItem(root, dist->GetStateKey(), | 226 item_list->AddSetRegValueWorkItem(root, dist->GetStateKey(), |
228 kChromeFrameReadyModeField, | 227 kChromeFrameReadyModeField, |
229 static_cast<int64>(1), true); | 228 static_cast<int64>(1), true); |
230 | 229 |
231 if (!item_list->Do()) { | 230 if (!item_list->Do()) { |
232 LOG(ERROR) << "Failed to end temporary opt out of GCF"; | 231 LOG(ERROR) << "Failed to end temporary opt out of GCF"; |
233 item_list->Rollback(); | 232 item_list->Rollback(); |
234 status = READY_MODE_END_TEMP_OPT_OUT_FAILED; | 233 status = READY_MODE_END_TEMP_OPT_OUT_FAILED; |
235 } | 234 } |
236 | 235 |
237 return status; | 236 return status; |
238 } | 237 } |
239 | 238 |
240 } // namespace installer | 239 } // namespace installer |
OLD | NEW |