From 0a92e3b1bd75aa16683621248492c46eb203576e Mon Sep 17 00:00:00 2001 From: "sail@chromium.org" Date: Mon, 28 Nov 2011 15:58:55 +0000 Subject: Merge 110998 - Disable sync promo for internet cafe distributions BUG=104995 TEST= Review URL: http://codereview.chromium.org/8592005 TBR=sail@chromium.org Review URL: http://codereview.chromium.org/8720009 git-svn-id: svn://svn.chromium.org/chrome/branches/912/src@111706 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/google/google_util.cc | 10 ++++++++++ chrome/browser/google/google_util.h | 3 +++ chrome/browser/ui/webui/sync_promo_ui.cc | 3 +++ 3 files changed, 16 insertions(+) diff --git a/chrome/browser/google/google_util.cc b/chrome/browser/google/google_util.cc index 9452c78..667e7eb 100644 --- a/chrome/browser/google/google_util.cc +++ b/chrome/browser/google/google_util.cc @@ -176,4 +176,14 @@ bool IsOrganicFirstRun(const std::string& brand) { StartsWithASCII(brand, "EU", true); } +bool IsInternetCafeBrandCode(const std::string& brand) { + const char* const kBrands[] = { + "CHIQ", "CHSG", "HLJY", "NTMO", "OOBA", "OOBB", "OOBC", "OOBD", "OOBE", + "OOBF", "OOBG", "OOBH", "OOBI", "OOBJ", + }; + const char* const* end = &kBrands[arraysize(kBrands)]; + const char* const* found = std::find(&kBrands[0], end, brand); + return found != end; +} + } // namespace google_util diff --git a/chrome/browser/google/google_util.h b/chrome/browser/google/google_util.h index b670b0e..7f5c47e 100644 --- a/chrome/browser/google/google_util.h +++ b/chrome/browser/google/google_util.h @@ -46,6 +46,9 @@ bool IsOrganic(const std::string& brand); // method. bool IsOrganicFirstRun(const std::string& brand); +// True if |brand| is an internet cafe brand code. +bool IsInternetCafeBrandCode(const std::string& brand); + // This class is meant to be used only from test code, and sets the brand // code returned by the function GetBrand() above while the object exists. class BrandForTesting { diff --git a/chrome/browser/ui/webui/sync_promo_ui.cc b/chrome/browser/ui/webui/sync_promo_ui.cc index 17d980e..905c108 100644 --- a/chrome/browser/ui/webui/sync_promo_ui.cc +++ b/chrome/browser/ui/webui/sync_promo_ui.cc @@ -46,6 +46,9 @@ bool AllowPromoAtStartupForCurrentBrand() { if (brand.empty()) return true; + if (google_util::IsInternetCafeBrandCode(brand)) + return false; + if (google_util::IsOrganic(brand)) return true; -- cgit v1.1