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

Side by Side Diff: chrome/browser/policy/managed_mode_policy_provider.cc

Issue 16072008: Hide web store icon from NTP for managed users (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/policy/managed_mode_policy_provider.h" 5 #include "chrome/browser/policy/managed_mode_policy_provider.h"
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/prefs/json_pref_store.h" 9 #include "base/prefs/json_pref_store.h"
10 #include "base/threading/sequenced_worker_pool.h" 10 #include "base/threading/sequenced_worker_pool.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 } 77 }
78 78
79 ManagedModePolicyProvider::~ManagedModePolicyProvider() {} 79 ManagedModePolicyProvider::~ManagedModePolicyProvider() {}
80 80
81 void ManagedModePolicyProvider::InitDefaults() { 81 void ManagedModePolicyProvider::InitDefaults() {
82 DCHECK(store_->IsInitializationComplete()); 82 DCHECK(store_->IsInitializationComplete());
83 if (GetCachedPolicy()) 83 if (GetCachedPolicy())
84 return; 84 return;
85 85
86 DictionaryValue* dict = new DictionaryValue; 86 DictionaryValue* dict = new DictionaryValue;
87 dict->SetBoolean(policy::key::kAllowDeletingBrowserHistory, false);
87 dict->SetInteger(policy::key::kContentPackDefaultFilteringBehavior, 88 dict->SetInteger(policy::key::kContentPackDefaultFilteringBehavior,
88 ManagedModeURLFilter::ALLOW); 89 ManagedModeURLFilter::ALLOW);
89 dict->SetBoolean(policy::key::kForceSafeSearch, true); 90 dict->SetBoolean(policy::key::kForceSafeSearch, true);
90 dict->SetBoolean(policy::key::kSigninAllowed, false); 91 dict->SetBoolean(policy::key::kHideWebStoreIcon, true);
91 dict->SetBoolean(policy::key::kAllowDeletingBrowserHistory, false);
92 dict->SetInteger(policy::key::kIncognitoModeAvailability, 92 dict->SetInteger(policy::key::kIncognitoModeAvailability,
93 IncognitoModePrefs::DISABLED); 93 IncognitoModePrefs::DISABLED);
94 dict->SetBoolean(policy::key::kSigninAllowed, false);
94 95
95 store_->SetValue(kPolicies, dict); 96 store_->SetValue(kPolicies, dict);
96 UpdatePolicyFromCache(); 97 UpdatePolicyFromCache();
97 } 98 }
98 99
99 void ManagedModePolicyProvider::InitDefaultsForTesting( 100 void ManagedModePolicyProvider::InitDefaultsForTesting(
100 scoped_ptr<DictionaryValue> dict) { 101 scoped_ptr<DictionaryValue> dict) {
101 DCHECK(store_->IsInitializationComplete()); 102 DCHECK(store_->IsInitializationComplete());
102 DCHECK(!GetCachedPolicy()); 103 DCHECK(!GetCachedPolicy());
103 store_->SetValue(kPolicies, dict.release()); 104 store_->SetValue(kPolicies, dict.release());
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 DictionaryValue* policies = GetCachedPolicy(); 283 DictionaryValue* policies = GetCachedPolicy();
283 if (policies) { 284 if (policies) {
284 PolicyMap* policy_map = &policy_bundle->Get( 285 PolicyMap* policy_map = &policy_bundle->Get(
285 PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())); 286 PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()));
286 policy_map->LoadFrom(policies, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER); 287 policy_map->LoadFrom(policies, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER);
287 } 288 }
288 UpdatePolicy(policy_bundle.Pass()); 289 UpdatePolicy(policy_bundle.Pass());
289 } 290 }
290 291
291 } // namespace policy 292 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698