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

Side by Side Diff: chrome/installer/setup/chrome_frame_ready_mode.cc

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

Powered by Google App Engine
This is Rietveld 408576698