Index: chrome/browser/extensions/apps_promo.cc |
diff --git a/chrome/browser/extensions/apps_promo.cc b/chrome/browser/extensions/apps_promo.cc |
index a6cc81b115a763b11e4796d2a1499c2a23f77f9e..d2dc70a11fd7440a5a49f9a7237dc4f09abe2b48 100644 |
--- a/chrome/browser/extensions/apps_promo.cc |
+++ b/chrome/browser/extensions/apps_promo.cc |
@@ -61,6 +61,9 @@ void AppsPromo::RegisterUserPrefs(PrefService* prefs) { |
prefs->RegisterStringPref(prefs::kNTPWebStorePromoLastId, |
std::string(), |
PrefService::UNSYNCABLE_PREF); |
+ prefs->RegisterBooleanPref(prefs::kNTPHideWebStorePromo, |
+ false, |
+ PrefService::UNSYNCABLE_PREF); |
} |
// static |
@@ -186,6 +189,12 @@ bool AppsPromo::ShouldShowPromo(const ExtensionIdSet& installed_ids, |
return true; |
} |
+ // Don't show the promo if the policy says not to. |
+ if (prefs_->GetBoolean(prefs::kNTPHideWebStorePromo)) { |
+ ExpireDefaultApps(); |
+ return false; |
+ } |
+ |
// Don't show the promo if one wasn't served to this locale. |
if (!IsPromoSupportedForLocale()) |
return false; |
@@ -211,11 +220,10 @@ bool AppsPromo::ShouldShowPromo(const ExtensionIdSet& installed_ids, |
extension_misc::PROMO_BUCKET_BOUNDARY); |
ExpireDefaultApps(); |
- return true; |
} else { |
SetPromoCounter(++promo_counter); |
- return true; |
} |
+ return true; |
Evan Stade
2011/08/09 19:54:55
as long as you are changing the logic around, I th
|
} else if (installed_ids.empty()) { |
return true; |
} |
@@ -226,7 +234,7 @@ bool AppsPromo::ShouldShowPromo(const ExtensionIdSet& installed_ids, |
bool AppsPromo::ShouldShowAppLauncher(const ExtensionIdSet& installed_ids) { |
// On Chrome OS the default apps are installed via a separate mechanism that |
// is always enabled. Therefore we always show the launcher. |
-#if defined(OS_CHROME) |
+#if defined(OS_CHROMEOS) |
return true; |
#else |