diff options
author | rogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-07 14:17:58 +0000 |
---|---|---|
committer | rogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-07 14:17:58 +0000 |
commit | 7a336d6ec8064a899458123d34b9a6739e49a0d9 (patch) | |
tree | 327c4a92d7ca092e6938ecd0bdee8d42429769c3 /chrome/installer/util | |
parent | d4e744e5fd8bd1aa831510cb23044d8017f14e17 (diff) | |
download | chromium_src-7a336d6ec8064a899458123d34b9a6739e49a0d9.zip chromium_src-7a336d6ec8064a899458123d34b9a6739e49a0d9.tar.gz chromium_src-7a336d6ec8064a899458123d34b9a6739e49a0d9.tar.bz2 |
Move brand code related function to a common place for all platforms. These
are Google specific APIs.
BUG=None
TEST=Make sure RLZ still uses correct brand code.
Review URL: http://codereview.chromium.org/8136006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104479 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/util')
-rw-r--r-- | chrome/installer/util/google_update_settings.cc | 29 | ||||
-rw-r--r-- | chrome/installer/util/google_update_settings.h | 15 |
2 files changed, 7 insertions, 37 deletions
diff --git a/chrome/installer/util/google_update_settings.cc b/chrome/installer/util/google_update_settings.cc index 5a6f4a2..b79e61a 100644 --- a/chrome/installer/util/google_update_settings.cc +++ b/chrome/installer/util/google_update_settings.cc @@ -486,35 +486,6 @@ bool GoogleUpdateSettings::WriteGoogleUpdateSystemClientKey( return status == ERROR_SUCCESS; } -bool GoogleUpdateSettings::IsOrganic(const std::wstring& brand) { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); - if (command_line.HasSwitch(switches::kOrganicInstall)) - return true; - - 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; - return (StartsWith(brand, L"EUB", true) || StartsWith(brand, L"EUC", true) || - StartsWith(brand, L"GGR", true)); -} - -bool GoogleUpdateSettings::IsOrganicFirstRun(const std::wstring& brand) { - // Used for testing, to force search engine selector to appear. - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); - if (command_line.HasSwitch(switches::kOrganicInstall)) - return true; - - return (StartsWith(brand, L"GG", true) || StartsWith(brand, L"EU", true)); -} - GoogleUpdateSettings::UpdatePolicy GoogleUpdateSettings::GetAppUpdatePolicy( const std::wstring& app_guid, bool* is_overridden) { diff --git a/chrome/installer/util/google_update_settings.h b/chrome/installer/util/google_update_settings.h index 243f451..ed84dfb 100644 --- a/chrome/installer/util/google_update_settings.h +++ b/chrome/installer/util/google_update_settings.h @@ -78,11 +78,18 @@ class GoogleUpdateSettings { // Returns in |brand| the RLZ brand code or distribution tag that has been // assigned to a partner. Returns false if the information is not available. + // + // NOTE: This function is Windows only. If the code you are writing is not + // specifically for Windows, prefer calling google_util::GetBrand(). static bool GetBrand(std::wstring* brand); // Returns in |brand| the RLZ reactivation brand code or distribution tag // that has been assigned to a partner for reactivating a dormant chrome // install. Returns false if the information is not available. + // + // NOTE: This function is Windows only. If the code you are writing is not + // specifically for Windows, prefer calling + // google_util::GetReactivationBrand(). static bool GetReactivationBrand(std::wstring* brand); // Returns in |client| the google_update client field, which is currently @@ -167,14 +174,6 @@ class GoogleUpdateSettings { const std::wstring& key, const std::wstring& value); - // True if a build is strictly organic, according to its brand code. - static bool IsOrganic(const std::wstring& brand); - - // True if a build should run as organic in the first run process. This uses - // a slightly different set of brand codes from the standard IsOrganic - // method. - static bool IsOrganicFirstRun(const std::wstring& brand); - // Returns the effective update policy for |app_guid| as dictated by // Group Policy settings. |is_overridden|, if non-NULL, is populated with // true if an app-specific policy override is in force, or false otherwise. |