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

Side by Side Diff: chrome/browser/configuration_policy_pref_store.h

Issue 1692011: Implementation of managed policy: Policy Abstraction (Closed)
Patch Set: check no changes Created 10 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/configuration_policy_pref_store.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CONFIGURATION_POLICY_PREF_STORE_H_
6 #define CHROME_BROWSER_CONFIGURATION_POLICY_PREF_STORE_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "base/scoped_ptr.h"
12 #include "base/values.h"
13 #include "chrome/browser/configuration_policy_store.h"
14 #include "chrome/browser/pref_store.h"
15 #include "testing/gtest/include/gtest/gtest_prod.h"
16
17 class ConfigurationPolicyProvider;
18
19 // An implementation of the |PrefStore| that holds a Dictionary
20 // created through applied policy.
21 class ConfigurationPolicyPrefStore : public PrefStore,
22 public ConfigurationPolicyStore {
23 public:
24 explicit ConfigurationPolicyPrefStore(ConfigurationPolicyProvider* provider);
25 virtual ~ConfigurationPolicyPrefStore() { }
26
27 // PrefStore methods:
28 virtual PrefReadError ReadPrefs();
29 virtual DictionaryValue* prefs() { return prefs_.get(); }
30
31 private:
32 // For unit tests.
33 FRIEND_TEST(ConfigurationPolicyPrefStoreTest, TestSettingHomePageDefault);
34 FRIEND_TEST(ConfigurationPolicyPrefStoreTest, TestSettingHomePageOverride);
35 FRIEND_TEST(ConfigurationPolicyPrefStoreTest,
36 TestSettingHomepageIsNewTabPageDefault);
37 FRIEND_TEST(ConfigurationPolicyPrefStoreTest,
38 TestSettingHomepageIsNewTabPage);
39 FRIEND_TEST(ConfigurationPolicyPrefStoreTest,
40 TestSettingCookiesEnabledDefault);
41 FRIEND_TEST(ConfigurationPolicyPrefStoreTest,
42 TestSettingCookiesEnabledOverride);
43
44 // Policies that map to a single preference are handled
45 // by an automated converter. Each one of these policies
46 // has an entry in |simple_policy_map_| with the following type.
47 struct PolicyToPreferenceMapEntry {
48 Value::ValueType value_type;
49 PolicyType policy_type;
50 const wchar_t* preference_path; // A DictionaryValue path, not a file path.
51 };
52
53 static const PolicyToPreferenceMapEntry simple_policy_map_[];
54
55 ConfigurationPolicyProvider* provider_;
56 scoped_ptr<DictionaryValue> prefs_;
57
58 // ConfigurationPolicyStore methods:
59 virtual void Apply(PolicyType setting, Value* value);
60
61 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyPrefStore);
62 };
63
64 #endif // CHROME_BROWSER_CONFIGURATION_POLICY_PREF_STORE_H_
65
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/configuration_policy_pref_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698