diff options
author | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-21 20:11:08 +0000 |
---|---|---|
committer | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-21 20:11:08 +0000 |
commit | cdd9fea014653052e1e2fc2a354b8526235bc65f (patch) | |
tree | c429690a9320d43be04b3013785af50d1333db72 /chrome_frame/utils.cc | |
parent | 82b0f03294d4a9ee705cddf4a157572ea91512e9 (diff) | |
download | chromium_src-cdd9fea014653052e1e2fc2a354b8526235bc65f.zip chromium_src-cdd9fea014653052e1e2fc2a354b8526235bc65f.tar.gz chromium_src-cdd9fea014653052e1e2fc2a354b8526235bc65f.tar.bz2 |
Remove old ap-value munging code in Chrome Frame.
Review URL: http://codereview.chromium.org/303023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29696 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/utils.cc')
-rw-r--r-- | chrome_frame/utils.cc | 71 |
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); |