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

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

Issue 6588003: Add support for the quick-enable-cf command to the installer. This encompase... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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
« no previous file with comments | « chrome/installer/util/installation_state.h ('k') | chrome/installer/util/installation_validator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/installation_state.cc
===================================================================
--- chrome/installer/util/installation_state.cc (revision 76747)
+++ chrome/installer/util/installation_state.cc (working copy)
@@ -25,6 +25,20 @@
BrowserDistribution::GetSpecificDistribution(type));
}
+// Initializes |commands| from the "Commands" subkey of |version_key|.
+// Returns false if there is no "Commands" subkey or on error.
+// static
+bool ProductState::InitializeCommands(const base::win::RegKey& version_key,
+ AppCommands* commands) {
+ static const DWORD kAccess = KEY_ENUMERATE_SUB_KEYS | KEY_QUERY_VALUE;
+ base::win::RegKey commands_key;
+
+ if (commands_key.Open(version_key.Handle(), google_update::kRegCommandsKey,
+ kAccess) == ERROR_SUCCESS)
+ return commands->Initialize(commands_key);
+ return false;
+}
+
bool ProductState::Initialize(bool system_install,
BrowserDistribution* distribution) {
const std::wstring version_key(distribution->GetVersionKey());
@@ -47,6 +61,8 @@
if (key.ReadValue(google_update::kRegRenameCmdField,
&rename_cmd_) != ERROR_SUCCESS)
rename_cmd_.clear();
+ if (!InitializeCommands(key, &commands_))
+ commands_.Clear();
// Read from the ClientState key.
channel_.set_value(std::wstring());
uninstall_command_ = CommandLine(CommandLine::NO_PROGRAM);
@@ -99,6 +115,7 @@
other.old_version_.get() == NULL ? NULL : other.old_version_->Clone());
rename_cmd_ = other.rename_cmd_;
uninstall_command_ = other.uninstall_command_;
+ commands_.CopyFrom(other.commands_);
msi_ = other.msi_;
multi_install_ = other.multi_install_;
« no previous file with comments | « chrome/installer/util/installation_state.h ('k') | chrome/installer/util/installation_validator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698