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

Unified Diff: chrome/installer/util/app_command.cc

Issue 10823437: Callback flow to register Chrome and update shortcuts after OS upgrade to Windows 8 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reimplementing registry changes using AppCommand; adding checks in InstallationValidator. Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/installer/util/app_command.cc
diff --git a/chrome/installer/util/app_command.cc b/chrome/installer/util/app_command.cc
index 588fe86fda307d9615af880aee0c6813d1e3aa1f..85532a8f66790da71667d107e2a659e5733ac781 100644
--- a/chrome/installer/util/app_command.cc
+++ b/chrome/installer/util/app_command.cc
@@ -18,10 +18,21 @@ AppCommand::AppCommand()
AppCommand::AppCommand(const std::wstring& command_line,
bool sends_pings,
+ bool is_web_accessible,
+ bool is_auto_run_on_os_upgrade)
+ : command_line_(command_line),
+ sends_pings_(sends_pings),
+ is_web_accessible_(is_web_accessible),
+ is_auto_run_on_os_upgrade_(is_auto_run_on_os_upgrade) {
+}
+
+AppCommand::AppCommand(const std::wstring& command_line,
+ bool sends_pings,
bool is_web_accessible)
: command_line_(command_line),
sends_pings_(sends_pings),
- is_web_accessible_(is_web_accessible) {
+ is_web_accessible_(is_web_accessible),
+ is_auto_run_on_os_upgrade_(false) {
}
bool AppCommand::Initialize(const base::win::RegKey& key) {
@@ -34,6 +45,7 @@ bool AppCommand::Initialize(const base::win::RegKey& key) {
std::wstring cmd_line;
DWORD sends_pings = 0;
DWORD is_web_acc = 0;
+ DWORD is_auto_run_on_os_upgrade = 0;
result = key.ReadValue(google_update::kRegCommandLineField, &cmd_line);
if (result != ERROR_SUCCESS) {
@@ -44,21 +56,24 @@ bool AppCommand::Initialize(const base::win::RegKey& key) {
result = key.ReadValueDW(google_update::kRegSendsPingsField, &sends_pings);
if (result != ERROR_SUCCESS) {
grt (UTC plus 2) 2012/08/28 19:35:39 ReadValueDW only modifies its out_value on success
huangs 2012/08/29 17:02:54 Done, also added comment.
- LOG(WARNING) << "Error reading " << google_update::kRegSendsPingsField
- << " value from registry: " << result;
- return false;
+ sends_pings = 0;
}
result = key.ReadValueDW(google_update::kRegWebAccessibleField, &is_web_acc);
if (result != ERROR_SUCCESS) {
- LOG(WARNING) << "Error reading " << google_update::kRegWebAccessibleField
- << " value from registry: " << result;
- return false;
+ is_web_acc = 0;
+ }
+
+ result = key.ReadValueDW(google_update::kRegAutoRunOnOSUpgrade,
+ &is_auto_run_on_os_upgrade);
+ if (result != ERROR_SUCCESS) {
+ is_auto_run_on_os_upgrade = 0;
}
command_line_.swap(cmd_line);
sends_pings_ = (sends_pings != 0);
is_web_accessible_ = (is_web_acc != 0);
+ is_auto_run_on_os_upgrade_ = (is_auto_run_on_os_upgrade != 0);
return true;
}
@@ -66,23 +81,24 @@ bool AppCommand::Initialize(const base::win::RegKey& key) {
void AppCommand::AddWorkItems(HKEY predefined_root,
const std::wstring& command_path,
WorkItemList* item_list) const {
- const DWORD sends_pings = sends_pings_ ? 1U : 0U;
- const DWORD is_web_accessible = is_web_accessible_ ? 1U : 0U;
-
item_list->AddCreateRegKeyWorkItem(predefined_root, command_path)
- ->set_log_message("creating quick-enable-cf command registry key");
+ ->set_log_message("creating AppCommand command registry key");
item_list->AddSetRegValueWorkItem(predefined_root, command_path,
google_update::kRegCommandLineField,
command_line_, true)
- ->set_log_message("setting quick-enable-cf CommandLine registry value");
- item_list->AddSetRegValueWorkItem(predefined_root, command_path,
- google_update::kRegSendsPingsField,
- sends_pings, true)
- ->set_log_message("setting quick-enable-cf SendsPings registry value");
- item_list->AddSetRegValueWorkItem(predefined_root, command_path,
- google_update::kRegWebAccessibleField,
- is_web_accessible, true)
- ->set_log_message("setting quick-enable-cf WebAccessible registry value");
+ ->set_log_message("setting AppCommand CommandLine registry value");
+ item_list->AddSetOptionalBoolRegValueWorkItem(
+ predefined_root, command_path, google_update::kRegSendsPingsField,
grt (UTC plus 2) 2012/08/28 19:35:39 can these be wrapped like line 87 and 88 (as they
huangs 2012/08/29 17:02:54 Done, convenient since AddSetOptionalBoolRegValueW
+ sends_pings_)
+ ->set_log_message("setting AppCommand SendsPings registry value");
+ item_list->AddSetOptionalBoolRegValueWorkItem(
+ predefined_root, command_path, google_update::kRegWebAccessibleField,
+ is_web_accessible_)
+ ->set_log_message("setting AppCommand WebAccessible registry value");
+ item_list->AddSetOptionalBoolRegValueWorkItem(
+ predefined_root, command_path, google_update::kRegAutoRunOnOSUpgrade,
+ is_auto_run_on_os_upgrade_)
+ ->set_log_message("setting AppCommand AutoRunOnOSUpgrade registry value");
}
} // namespace installer

Powered by Google App Engine
This is Rietveld 408576698