diff options
author | mirandac@google.com <mirandac@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-02 20:34:09 +0000 |
---|---|---|
committer | mirandac@google.com <mirandac@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-02 20:34:09 +0000 |
commit | cbe7a169e2395eaec83c8dbfba16616de4e6700b (patch) | |
tree | a9d6d07f1de44e35ba7b34303d1da3fffffa8aea /chrome/installer/util/google_update_settings.cc | |
parent | 6ba198fd7a578d370215fd5816962286070f9b3c (diff) | |
download | chromium_src-cbe7a169e2395eaec83c8dbfba16616de4e6700b.zip chromium_src-cbe7a169e2395eaec83c8dbfba16616de4e6700b.tar.gz chromium_src-cbe7a169e2395eaec83c8dbfba16616de4e6700b.tar.bz2 |
Refactor check for organic install into GoogleUpdateSettings, for use elsewhere.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/2836041
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51564 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/util/google_update_settings.cc')
-rw-r--r-- | chrome/installer/util/google_update_settings.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/chrome/installer/util/google_update_settings.cc b/chrome/installer/util/google_update_settings.cc index a5460e2..d7ffe99 100644 --- a/chrome/installer/util/google_update_settings.cc +++ b/chrome/installer/util/google_update_settings.cc @@ -239,3 +239,20 @@ std::wstring GoogleUpdateSettings::GetNewGoogleUpdateApKey( return new_value; } +bool GoogleUpdateSettings::IsOrganic(const std::wstring& brand) { + static const wchar_t* kBrands[] = { + L"CHFO", L"CHFT", L"CHHS", L"CHHM", L"CHMA", L"CHMB", L"CHME", L"CHMF", + L"CHMG", L"CHMH", L"CHMI", L"CHMQ", L"CHMV", L"CHNB", L"CHNC", L"CHNG", + L"CHNH", L"CHNI", L"CHOA", L"CHOB", L"CHOC", L"CHON", L"CHOO", L"CHOP", + L"CHOQ", L"CHOR", L"CHOS", L"CHOT", L"CHOU", L"CHOX", L"CHOY", L"CHOZ", + L"CHPD", L"CHPE", L"CHPF", L"CHPG", L"EUBB", L"EUBC", L"GGLA", L"GGLS" + }; + const wchar_t** end = &kBrands[arraysize(kBrands)]; + const wchar_t** found = std::find(&kBrands[0], end, brand); + if (found != end) + return true; + if (StartsWith(brand, L"EUB", true) || StartsWith(brand, L"EUC", true) || + StartsWith(brand, L"GGR", true)) + return true; + return false; +} |