summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/installer/util/chrome_frame_distribution.cc31
-rw-r--r--chrome/installer/util/chrome_frame_distribution.h6
2 files changed, 37 insertions, 0 deletions
diff --git a/chrome/installer/util/chrome_frame_distribution.cc b/chrome/installer/util/chrome_frame_distribution.cc
index 124edd3..7204a72 100644
--- a/chrome/installer/util/chrome_frame_distribution.cc
+++ b/chrome/installer/util/chrome_frame_distribution.cc
@@ -9,6 +9,12 @@
#include "chrome/installer/util/chrome_frame_distribution.h"
+#include <string>
+#include <windows.h>
+
+#include "base/logging.h"
+#include "base/registry.h"
+#include "base/string_util.h"
#include "chrome/installer/util/l10n_string_util.h"
#include "chrome/installer/util/google_update_constants.h"
@@ -86,3 +92,28 @@ int ChromeFrameDistribution::GetInstallReturnCode(
return status;
}
}
+
+void ChromeFrameDistribution::UpdateDiffInstallStatus(bool system_install,
+ bool incremental_install, installer_util::InstallStatus install_status) {
+ HKEY reg_root = (system_install) ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
+ RegKey key;
+ std::wstring ap_key_value;
+ std::wstring reg_key(google_update::kRegPathClientState);
+ reg_key.append(L"\\");
+ reg_key.append(google_update::kChromeGuid);
+ if (!key.Open(reg_root, reg_key.c_str(), KEY_ALL_ACCESS) ||
+ !key.ReadValue(google_update::kRegApField, &ap_key_value)) {
+ LOG(INFO) << "Application key not found.";
+ } else {
+ const char kMagicSuffix[] = "-full";
+ if (LowerCaseEqualsASCII(ap_key_value, kMagicSuffix)) {
+ key.DeleteValue(google_update::kRegApField);
+ } else {
+ size_t pos = ap_key_value.find(ASCIIToWide(kMagicSuffix));
+ if (pos != std::wstring::npos) {
+ ap_key_value.erase(pos, strlen(kMagicSuffix));
+ key.WriteValue(google_update::kRegApField, ap_key_value.c_str());
+ }
+ }
+ }
+}
diff --git a/chrome/installer/util/chrome_frame_distribution.h b/chrome/installer/util/chrome_frame_distribution.h
index 98a250d..ac6eaa8 100644
--- a/chrome/installer/util/chrome_frame_distribution.h
+++ b/chrome/installer/util/chrome_frame_distribution.h
@@ -39,6 +39,12 @@ class ChromeFrameDistribution : public BrowserDistribution {
virtual int GetInstallReturnCode(installer_util::InstallStatus status);
+ // This is the point at which the Google Chrome installer removes the Google
+ // Update ap value. We implement this simply to have the same behaviour re.
+ // the ap value.
+ virtual void UpdateDiffInstallStatus(bool system_install,
+ bool incremental_install, installer_util::InstallStatus install_status);
+
private:
friend class BrowserDistribution;