diff options
author | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-05 04:59:48 +0000 |
---|---|---|
committer | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-05 04:59:48 +0000 |
commit | 5f2cee8b6e2760e626646651556a808a4cd5a6b1 (patch) | |
tree | 63d0385a235c5b0ee5cd8eb6d3c429debabfc98d /chrome/installer/util | |
parent | 403fe1585a183e133108e5a1564226e4f7654143 (diff) | |
download | chromium_src-5f2cee8b6e2760e626646651556a808a4cd5a6b1.zip chromium_src-5f2cee8b6e2760e626646651556a808a4cd5a6b1.tar.gz chromium_src-5f2cee8b6e2760e626646651556a808a4cd5a6b1.tar.bz2 |
Push the Omaha app guid into the browser distribution classes to remove compile-time differences between Chrome Frame and Chrome.
Review URL: http://codereview.chromium.org/361023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31073 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/util')
9 files changed, 37 insertions, 14 deletions
diff --git a/chrome/installer/util/browser_distribution.cc b/chrome/installer/util/browser_distribution.cc index 4298a0c..844817c 100644 --- a/chrome/installer/util/browser_distribution.cc +++ b/chrome/installer/util/browser_distribution.cc @@ -44,6 +44,10 @@ void BrowserDistribution::DoPostUninstallOperations( const std::wstring& distribution_data) { } +std::wstring BrowserDistribution::GetAppGuid() { + return L""; +} + std::wstring BrowserDistribution::GetApplicationName() { return L"Chromium"; } diff --git a/chrome/installer/util/browser_distribution.h b/chrome/installer/util/browser_distribution.h index efb30145..aa0aa5f 100644 --- a/chrome/installer/util/browser_distribution.h +++ b/chrome/installer/util/browser_distribution.h @@ -23,6 +23,8 @@ class BrowserDistribution { const std::wstring& local_data_path, const std::wstring& distribution_data); + virtual std::wstring GetAppGuid(); + virtual std::wstring GetApplicationName(); virtual std::wstring GetAlternateApplicationName(); diff --git a/chrome/installer/util/chrome_frame_distribution.cc b/chrome/installer/util/chrome_frame_distribution.cc index 7204a72..85317e6 100644 --- a/chrome/installer/util/chrome_frame_distribution.cc +++ b/chrome/installer/util/chrome_frame_distribution.cc @@ -20,6 +20,14 @@ #include "installer_util_strings.h" +namespace { +const wchar_t kChromeFrameGuid[] = L"{8BA986DA-5100-405E-AA35-86F34A02ACBF}"; +} + +std::wstring ChromeFrameDistribution::GetAppGuid() { + return kChromeFrameGuid; +} + std::wstring ChromeFrameDistribution::GetApplicationName() { // TODO(robertshield): localize return L"Google Chrome Frame"; @@ -48,14 +56,14 @@ std::wstring ChromeFrameDistribution::GetAppDescription() { std::wstring ChromeFrameDistribution::GetStateKey() { std::wstring key(google_update::kRegPathClientState); key.append(L"\\"); - key.append(google_update::kChromeGuid); + key.append(kChromeFrameGuid); return key; } std::wstring ChromeFrameDistribution::GetStateMediumKey() { std::wstring key(google_update::kRegPathClientStateMedium); key.append(L"\\"); - key.append(google_update::kChromeGuid); + key.append(kChromeFrameGuid); return key; } @@ -76,7 +84,7 @@ std::wstring ChromeFrameDistribution::GetUninstallRegPath() { std::wstring ChromeFrameDistribution::GetVersionKey() { std::wstring key(google_update::kRegPathClients); key.append(L"\\"); - key.append(google_update::kChromeGuid); + key.append(kChromeFrameGuid); return key; } @@ -100,7 +108,7 @@ void ChromeFrameDistribution::UpdateDiffInstallStatus(bool system_install, std::wstring ap_key_value; std::wstring reg_key(google_update::kRegPathClientState); reg_key.append(L"\\"); - reg_key.append(google_update::kChromeGuid); + reg_key.append(kChromeFrameGuid); 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."; diff --git a/chrome/installer/util/chrome_frame_distribution.h b/chrome/installer/util/chrome_frame_distribution.h index ac6eaa8..ca9790c 100644 --- a/chrome/installer/util/chrome_frame_distribution.h +++ b/chrome/installer/util/chrome_frame_distribution.h @@ -15,6 +15,8 @@ class ChromeFrameDistribution : public BrowserDistribution { public: + virtual std::wstring GetAppGuid(); + virtual std::wstring GetApplicationName(); virtual std::wstring GetAlternateApplicationName(); diff --git a/chrome/installer/util/google_chrome_distribution.cc b/chrome/installer/util/google_chrome_distribution.cc index e4ee42b..c5a14d2 100644 --- a/chrome/installer/util/google_chrome_distribution.cc +++ b/chrome/installer/util/google_chrome_distribution.cc @@ -32,6 +32,8 @@ #include "installer_util_strings.h" namespace { +const wchar_t kChromeGuid[] = L"{8A69D345-D564-463c-AFF1-A69D9E530F96}"; + // The following strings are the possible outcomes of the toast experiment // as recorded in the |client| field. Previously the groups used "TSxx" but // the data captured is not valid. @@ -229,6 +231,10 @@ void GoogleChromeDistribution::DoPostUninstallOperations( WMIProcessUtil::Launch(command, &pid); } +std::wstring GoogleChromeDistribution::GetAppGuid() { + return kChromeGuid; +} + std::wstring GoogleChromeDistribution::GetApplicationName() { const std::wstring& product_name = installer_util::GetLocalizedString(IDS_PRODUCT_NAME_BASE); @@ -299,14 +305,14 @@ int GoogleChromeDistribution::GetInstallReturnCode( std::wstring GoogleChromeDistribution::GetStateKey() { std::wstring key(google_update::kRegPathClientState); key.append(L"\\"); - key.append(google_update::kChromeGuid); + key.append(kChromeGuid); return key; } std::wstring GoogleChromeDistribution::GetStateMediumKey() { std::wstring key(google_update::kRegPathClientStateMedium); key.append(L"\\"); - key.append(google_update::kChromeGuid); + key.append(kChromeGuid); return key; } @@ -318,7 +324,7 @@ std::wstring GoogleChromeDistribution::GetDistributionData(RegKey* key) { DCHECK(NULL != key); std::wstring sub_key(google_update::kRegPathClientState); sub_key.append(L"\\"); - sub_key.append(google_update::kChromeGuid); + sub_key.append(kChromeGuid); RegKey client_state_key(key->Handle(), sub_key.c_str()); std::wstring result; @@ -365,7 +371,7 @@ std::wstring GoogleChromeDistribution::GetUninstallRegPath() { std::wstring GoogleChromeDistribution::GetVersionKey() { std::wstring key(google_update::kRegPathClients); key.append(L"\\"); - key.append(google_update::kChromeGuid); + key.append(kChromeGuid); return key; } @@ -385,7 +391,7 @@ void GoogleChromeDistribution::UpdateDiffInstallStatus(bool system_install, std::wstring ap_key_value; std::wstring reg_key(google_update::kRegPathClientState); reg_key.append(L"\\"); - reg_key.append(google_update::kChromeGuid); + reg_key.append(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."; @@ -396,7 +402,7 @@ void GoogleChromeDistribution::UpdateDiffInstallStatus(bool system_install, } else if (!key.Valid()) { reg_key.assign(google_update::kRegPathClientState); if (!key.Open(reg_root, reg_key.c_str(), KEY_ALL_ACCESS) || - !key.CreateKey(google_update::kChromeGuid, KEY_ALL_ACCESS)) { + !key.CreateKey(kChromeGuid, KEY_ALL_ACCESS)) { LOG(ERROR) << "Failed to create application key."; key.Close(); return; diff --git a/chrome/installer/util/google_chrome_distribution.h b/chrome/installer/util/google_chrome_distribution.h index c572f38..b72c534 100644 --- a/chrome/installer/util/google_chrome_distribution.h +++ b/chrome/installer/util/google_chrome_distribution.h @@ -30,6 +30,8 @@ class GoogleChromeDistribution : public BrowserDistribution { const std::wstring& local_data_path, const std::wstring& distribution_data); + virtual std::wstring GetAppGuid(); + virtual std::wstring GetApplicationName(); virtual std::wstring GetAlternateApplicationName(); diff --git a/chrome/installer/util/google_chrome_distribution_unittest.cc b/chrome/installer/util/google_chrome_distribution_unittest.cc index 23f174a..0df160c 100644 --- a/chrome/installer/util/google_chrome_distribution_unittest.cc +++ b/chrome/installer/util/google_chrome_distribution_unittest.cc @@ -46,7 +46,9 @@ class GoogleChromeDistributionTest : public testing::Test { std::wstring GetApKeyPath() { std::wstring reg_key(google_update::kRegPathClientState); reg_key.append(L"\\"); - reg_key.append(google_update::kChromeGuid); + + BrowserDistribution* dist = BrowserDistribution::GetDistribution(); + reg_key.append(dist->GetAppGuid()); return reg_key; } diff --git a/chrome/installer/util/google_update_constants.cc b/chrome/installer/util/google_update_constants.cc index 4586f07..7b9fc2a 100644 --- a/chrome/installer/util/google_update_constants.cc +++ b/chrome/installer/util/google_update_constants.cc @@ -4,8 +4,6 @@ #include "chrome/installer/util/google_update_constants.h" -#include "appid.h" - namespace google_update { const wchar_t kGearsUpgradeCode[] = L"{D92DBAED-3E3E-4530-B30D-072D16C7DDD0}"; diff --git a/chrome/installer/util/google_update_constants.h b/chrome/installer/util/google_update_constants.h index 5deb946..cfb7ab1 100644 --- a/chrome/installer/util/google_update_constants.h +++ b/chrome/installer/util/google_update_constants.h @@ -9,7 +9,6 @@ namespace google_update { -extern const wchar_t kChromeGuid[]; // Strictly speaking Google Update doesn't care about this GUID but it is still // related to install as it is used by MSI to identify Gears. extern const wchar_t kGearsUpgradeCode[]; |