summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-28 15:58:55 +0000
committersail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-28 15:58:55 +0000
commit0a92e3b1bd75aa16683621248492c46eb203576e (patch)
treee6176c82147d50b13dc68040d8395c6f10272e23
parent522f4e5b41073abe8725c694abd20e4cfd49dfc1 (diff)
downloadchromium_src-0a92e3b1bd75aa16683621248492c46eb203576e.zip
chromium_src-0a92e3b1bd75aa16683621248492c46eb203576e.tar.gz
chromium_src-0a92e3b1bd75aa16683621248492c46eb203576e.tar.bz2
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
-rw-r--r--chrome/browser/google/google_util.cc10
-rw-r--r--chrome/browser/google/google_util.h3
-rw-r--r--chrome/browser/ui/webui/sync_promo_ui.cc3
3 files changed, 16 insertions, 0 deletions
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;