| 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/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 // This creates the uninstallation entry for GCF. | 76 // This creates the uninstallation entry for GCF. |
| 77 AddUninstallShortcutWorkItems(cmd_line.GetProgram(), | 77 AddUninstallShortcutWorkItems(cmd_line.GetProgram(), |
| 78 product_state->version(), item_list.get(), *cf_product.get()); | 78 product_state->version(), item_list.get(), *cf_product.get()); |
| 79 // This updates the Chrome uninstallation entries. | 79 // This updates the Chrome uninstallation entries. |
| 80 AddUninstallShortcutWorkItems(cmd_line.GetProgram(), | 80 AddUninstallShortcutWorkItems(cmd_line.GetProgram(), |
| 81 product_state->version(), item_list.get(), *chrome_product.get()); | 81 product_state->version(), item_list.get(), *chrome_product.get()); |
| 82 | 82 |
| 83 // Add a work item to delete the ChromeFrameReadyMode registry value. | 83 // Add a work item to delete the ChromeFrameReadyMode registry value. |
| 84 HKEY root = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; | 84 HKEY root = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; |
| 85 item_list->AddDeleteRegValueWorkItem(root, package_properties.GetStateKey(), | 85 item_list->AddDeleteRegValueWorkItem(root, package_properties.GetStateKey(), |
| 86 kChromeFrameReadyModeField, REG_QWORD); | 86 kChromeFrameReadyModeField); |
| 87 | 87 |
| 88 // Delete the command elevation registry keys | 88 // Delete the command elevation registry keys |
| 89 std::wstring version_key(cf->GetVersionKey()); | 89 std::wstring version_key(cf->GetVersionKey()); |
| 90 item_list->AddDeleteRegValueWorkItem( | 90 item_list->AddDeleteRegValueWorkItem( |
| 91 root, version_key, google_update::kRegCFTempOptOutCmdField, REG_SZ); | 91 root, version_key, google_update::kRegCFTempOptOutCmdField); |
| 92 item_list->AddDeleteRegValueWorkItem( | 92 item_list->AddDeleteRegValueWorkItem( |
| 93 root, version_key, google_update::kRegCFEndTempOptOutCmdField, REG_SZ); | 93 root, version_key, google_update::kRegCFEndTempOptOutCmdField); |
| 94 item_list->AddDeleteRegValueWorkItem(root, version_key, | 94 item_list->AddDeleteRegValueWorkItem(root, version_key, |
| 95 google_update::kRegCFOptOutCmdField, | 95 google_update::kRegCFOptOutCmdField); |
| 96 REG_SZ); | |
| 97 item_list->AddDeleteRegValueWorkItem(root, version_key, | 96 item_list->AddDeleteRegValueWorkItem(root, version_key, |
| 98 google_update::kRegCFOptInCmdField, | 97 google_update::kRegCFOptInCmdField); |
| 99 REG_SZ); | |
| 100 | 98 |
| 101 if (!item_list->Do()) { | 99 if (!item_list->Do()) { |
| 102 LOG(ERROR) << "Failed to opt into GCF"; | 100 LOG(ERROR) << "Failed to opt into GCF"; |
| 103 item_list->Rollback(); | 101 item_list->Rollback(); |
| 104 status = READY_MODE_OPT_IN_FAILED; | 102 status = READY_MODE_OPT_IN_FAILED; |
| 105 } | 103 } |
| 106 } | 104 } |
| 107 | 105 |
| 108 return status; | 106 return status; |
| 109 } | 107 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 134 } else { | 132 } else { |
| 135 scoped_ptr<WorkItemList> item_list(WorkItem::CreateWorkItemList()); | 133 scoped_ptr<WorkItemList> item_list(WorkItem::CreateWorkItemList()); |
| 136 | 134 |
| 137 HKEY root = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; | 135 HKEY root = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; |
| 138 | 136 |
| 139 // Add a work item to delete the ChromeFrame user agent registry value. | 137 // Add a work item to delete the ChromeFrame user agent registry value. |
| 140 base::win::RegistryValueIterator values(root, kPostPlatformUAKey); | 138 base::win::RegistryValueIterator values(root, kPostPlatformUAKey); |
| 141 while (values.Valid()) { | 139 while (values.Valid()) { |
| 142 const wchar_t* name = values.Name(); | 140 const wchar_t* name = values.Name(); |
| 143 if (StartsWith(name, kChromeFramePrefix, true)) { | 141 if (StartsWith(name, kChromeFramePrefix, true)) { |
| 144 item_list->AddDeleteRegValueWorkItem(root, kPostPlatformUAKey, name, | 142 item_list->AddDeleteRegValueWorkItem(root, kPostPlatformUAKey, name); |
| 145 REG_SZ); | |
| 146 } | 143 } |
| 147 ++values; | 144 ++values; |
| 148 } | 145 } |
| 149 | 146 |
| 150 // Add a work item to update the Ready Mode state flag | 147 // Add a work item to update the Ready Mode state flag |
| 151 int64 timestamp = base::Time::Now().ToInternalValue(); | 148 int64 timestamp = base::Time::Now().ToInternalValue(); |
| 152 item_list->AddSetRegValueWorkItem(root, package_properties.GetStateKey(), | 149 item_list->AddSetRegValueWorkItem(root, package_properties.GetStateKey(), |
| 153 kChromeFrameReadyModeField, timestamp, | 150 kChromeFrameReadyModeField, timestamp, |
| 154 true); | 151 true); |
| 155 | 152 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 LOG(ERROR) << "Failed to end temporary opt out of GCF"; | 204 LOG(ERROR) << "Failed to end temporary opt out of GCF"; |
| 208 item_list->Rollback(); | 205 item_list->Rollback(); |
| 209 status = READY_MODE_END_TEMP_OPT_OUT_FAILED; | 206 status = READY_MODE_END_TEMP_OPT_OUT_FAILED; |
| 210 } | 207 } |
| 211 } | 208 } |
| 212 | 209 |
| 213 return status; | 210 return status; |
| 214 } | 211 } |
| 215 | 212 |
| 216 } // namespace installer | 213 } // namespace installer |
| OLD | NEW |