| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/webui/sync_promo_ui.h" | 5 #include "chrome/browser/ui/webui/sync_promo_ui.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/first_run/first_run.h" | 10 #include "chrome/browser/first_run/first_run.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 const int kSyncPromoShowAtStartupMaximum = 10; | 39 const int kSyncPromoShowAtStartupMaximum = 10; |
| 40 | 40 |
| 41 // Checks we want to show the sync promo for the given brand. | 41 // Checks we want to show the sync promo for the given brand. |
| 42 bool AllowPromoAtStartupForCurrentBrand() { | 42 bool AllowPromoAtStartupForCurrentBrand() { |
| 43 std::string brand; | 43 std::string brand; |
| 44 google_util::GetBrand(&brand); | 44 google_util::GetBrand(&brand); |
| 45 | 45 |
| 46 if (brand.empty()) | 46 if (brand.empty()) |
| 47 return true; | 47 return true; |
| 48 | 48 |
| 49 if (google_util::IsInternetCafeBrandCode(brand)) |
| 50 return false; |
| 51 |
| 49 if (google_util::IsOrganic(brand)) | 52 if (google_util::IsOrganic(brand)) |
| 50 return true; | 53 return true; |
| 51 | 54 |
| 52 if (StartsWithASCII(brand, "CH", true)) | 55 if (StartsWithASCII(brand, "CH", true)) |
| 53 return true; | 56 return true; |
| 54 | 57 |
| 55 // Default to disallow for all other brand codes. | 58 // Default to disallow for all other brand codes. |
| 56 return false; | 59 return false; |
| 57 } | 60 } |
| 58 | 61 |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 UTF16ToUTF8(output.data(), output.length(), &url); | 246 UTF16ToUTF8(output.data(), output.length(), &url); |
| 244 return GURL(url); | 247 return GURL(url); |
| 245 } | 248 } |
| 246 return GURL(); | 249 return GURL(); |
| 247 } | 250 } |
| 248 | 251 |
| 249 // static | 252 // static |
| 250 bool SyncPromoUI::UserHasSeenSyncPromoAtStartup(Profile* profile) { | 253 bool SyncPromoUI::UserHasSeenSyncPromoAtStartup(Profile* profile) { |
| 251 return profile->GetPrefs()->GetInteger(prefs::kSyncPromoStartupCount) > 0; | 254 return profile->GetPrefs()->GetInteger(prefs::kSyncPromoStartupCount) > 0; |
| 252 } | 255 } |
| OLD | NEW |