Index: chrome/installer/util/installer_state.cc |
diff --git a/chrome/installer/util/installer_state.cc b/chrome/installer/util/installer_state.cc |
index bc365de421198549c97fb728c00bc7fdd9ce6f30..5e88ad50d1af57df8ab9aca165ae7f5d456ad6c1 100644 |
--- a/chrome/installer/util/installer_state.cc |
+++ b/chrome/installer/util/installer_state.cc |
@@ -156,6 +156,11 @@ void InstallerState::Initialize(const CommandLine& command_line, |
state_key_ = operand->GetStateKey(); |
state_type_ = operand->GetType(); |
+ |
+ // Parse --critical-update-version=W.X.Y.Z |
+ std::string critical_version_value( |
+ command_line.GetSwitchValueASCII(switches::kCriticalUpdateVersion)); |
+ critical_update_version_ = Version(critical_version_value); |
} |
void InstallerState::set_level(Level level) { |
@@ -413,6 +418,20 @@ Version* InstallerState::GetCurrentVersion( |
return current_version.release(); |
} |
+Version InstallerState::DetermineCriticalVersion( |
+ const Version* current_version, |
+ const Version& new_version) const { |
+ DCHECK(current_version == NULL || current_version->IsValid()); |
+ DCHECK(new_version.IsValid()); |
+ if (critical_update_version_.IsValid() && |
+ (current_version == NULL || |
+ (current_version->CompareTo(critical_update_version_) < 0)) && |
+ new_version.CompareTo(critical_update_version_) >= 0) { |
+ return critical_update_version_; |
+ } |
+ return Version(); |
+} |
+ |
bool InstallerState::IsChromeFrameRunning( |
const InstallationState& machine_state) const { |
// We check only for the current version (e.g. the version we are upgrading |