summaryrefslogtreecommitdiffstats
path: root/chrome_frame/utils.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome_frame/utils.cc')
-rw-r--r--chrome_frame/utils.cc71
1 files changed, 0 insertions, 71 deletions
diff --git a/chrome_frame/utils.cc b/chrome_frame/utils.cc
index 36e8afd..246fa0d 100644
--- a/chrome_frame/utils.cc
+++ b/chrome_frame/utils.cc
@@ -194,77 +194,6 @@ HRESULT UtilGetXUACompatContentValue(const std::wstring& html_string,
return E_FAIL;
}
-bool AppendSuffixToChannelName(std::wstring* string,
- const std::wstring& channel_name,
- const std::wstring& suffix) {
- size_t pos = string->find(channel_name);
- // Append the suffix only if we find the channel name.
- if (pos != std::wstring::npos) {
- pos += channel_name.size();
- // Append the suffix only to the channel name only if the name is not
- // already followed by suffix.
- if (string->find(suffix, pos) != pos) {
- string->insert(pos, suffix);
- return true;
- }
- }
- return false;
-}
-
-bool RemoveSuffixFromChannelName(std::wstring* string,
- const std::wstring& channel_name,
- const std::wstring& suffix) {
- std::wstring decorated_channel(channel_name + suffix);
- size_t pos = string->find(decorated_channel);
- // TODO(robertshield): Remove the suffix iff the suffix is the last thing in
- // the string or is followed by another suffix that starts with '-'.
- if (pos != std::wstring::npos) {
- pos += channel_name.size();
- string->erase(pos, suffix.size());
- return true;
- }
- return false;
-}
-
-HRESULT UtilUpdateOmahaConfig(bool add_cf_suffix) {
- HKEY reg_root = HKEY_LOCAL_MACHINE;
-
- 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_READ | KEY_WRITE) ||
- !key.ReadValue(google_update::kRegApField, &ap_key_value)) {
- // Can't read the Omaha config.
- return REGDB_E_READREGDB;
- }
-
- HRESULT result = S_OK;
- // We've read the key in, try and modify it then write it back.
- if (add_cf_suffix && AppendSuffixToChannelName(&ap_key_value,
- kDevChannelName,
- kChromeFrameOmahaSuffix)) {
- if (!key.WriteValue(google_update::kRegApField, ap_key_value.c_str())) {
- DLOG(ERROR) << "Failed to add suffix to omaha ap key value.";
- result = REGDB_E_WRITEREGDB;
- }
- } else if (!add_cf_suffix &&
- RemoveSuffixFromChannelName(&ap_key_value,
- kDevChannelName,
- kChromeFrameOmahaSuffix)) {
- if (!key.WriteValue(google_update::kRegApField, ap_key_value.c_str())) {
- DLOG(ERROR) << "Failed to remove suffix from omaha ap key value.";
- result = REGDB_E_WRITEREGDB;
- }
- } else {
- // Getting here means that no modifications needed to be made.
- result = S_FALSE;
- }
-
- return result;
-}
-
std::wstring GetResourceString(int resource_id) {
std::wstring resource_string;
HMODULE this_module = reinterpret_cast<HMODULE>(&__ImageBase);