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

Unified Diff: chrome/browser/policy/configuration_policy_pref_store.cc

Issue 8135001: Fixed behavior of the bookmark bar visibility. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DCHECK_EQ instead of DCHECK Created 9 years, 2 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
Index: chrome/browser/policy/configuration_policy_pref_store.cc
diff --git a/chrome/browser/policy/configuration_policy_pref_store.cc b/chrome/browser/policy/configuration_policy_pref_store.cc
index 2cae83c9e8710a1dc04ed8ffadc0765eaa9481a4..7730c7c8a5d6fe7671931847031eaf81cc68dd32 100644
--- a/chrome/browser/policy/configuration_policy_pref_store.cc
+++ b/chrome/browser/policy/configuration_policy_pref_store.cc
@@ -106,10 +106,6 @@ class ConfigurationPolicyPrefKeeper {
// the function takes ownership of |value|.
bool ApplyIncognitoModePolicy(ConfigurationPolicyType policy, Value* value);
- // Processes a policy that can disable the bookmarks bar. It can also affect
- // other preferences.
- bool ApplyBookmarksPolicy(ConfigurationPolicyType policy, Value* value);
-
// Make sure that the |path| if present in |prefs_|. If not, set it to
// a blank string.
void EnsureStringPrefExists(const std::string& path);
@@ -291,6 +287,8 @@ const ConfigurationPolicyPrefKeeper::PolicyToPreferenceMapEntry
prefs::kPluginsAllowOutdated },
{ Value::TYPE_BOOLEAN, kPolicyAlwaysAuthorizePlugins,
prefs::kPluginsAlwaysAuthorize },
+ { Value::TYPE_BOOLEAN, kPolicyBookmarkBarEnabled,
+ prefs::kShowBookmarkBar },
{ Value::TYPE_BOOLEAN, kPolicyEditBookmarksEnabled,
prefs::kEditBookmarksEnabled },
{ Value::TYPE_BOOLEAN, kPolicyAllowFileSelectionDialogs,
@@ -395,7 +393,6 @@ void ConfigurationPolicyPrefKeeper::Apply(PolicyMap* policies) {
ApplyFileSelectionDialogsPolicy(current->first, value) ||
ApplyDefaultSearchPolicy(current->first, value) ||
ApplyIncognitoModePolicy(current->first, value) ||
- ApplyBookmarksPolicy(current->first, value) ||
ApplyPolicyFromMap(current->first, value,
kSimplePolicyMap, arraysize(kSimplePolicyMap))) {
continue;
@@ -621,21 +618,6 @@ bool ConfigurationPolicyPrefKeeper::ApplyIncognitoModePolicy(
return false;
}
-bool ConfigurationPolicyPrefKeeper::ApplyBookmarksPolicy(
- ConfigurationPolicyType policy,
- Value* value) {
- if (policy != kPolicyBookmarkBarEnabled)
- return false;
- DCHECK_EQ(Value::TYPE_BOOLEAN, value->GetType());
- prefs_.SetValue(prefs::kEnableBookmarkBar, value);
- // kShowBookmarkBar is not managed directly by a policy, but when
- // kEnableBookmarkBar is managed, kShowBookmarkBar should be false so that
- // the bookmarks bar either is completely disabled or only shows on the NTP.
- // This also disables the checkbox for this preference in the prefs UI.
- prefs_.SetValue(prefs::kShowBookmarkBar, Value::CreateBooleanValue(false));
- return true;
-}
-
void ConfigurationPolicyPrefKeeper::EnsureStringPrefExists(
const std::string& path) {
std::string value;
« no previous file with comments | « chrome/browser/importer/profile_writer.cc ('k') | chrome/browser/policy/configuration_policy_pref_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698