Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(471)

Unified Diff: chrome/browser/extensions/apps_promo.cc

Issue 7528024: Add a policy to allow NTP promotions & default apps to be disabled. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Disable app promo tests for ChromeOS. Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/policy/policy_templates.json ('k') | chrome/browser/extensions/apps_promo_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « chrome/app/policy/policy_templates.json ('k') | chrome/browser/extensions/apps_promo_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698