| OLD | NEW |
| 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 #ifndef CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PREF_STORE_H_ | 5 #ifndef CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PREF_STORE_H_ |
| 6 #define CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PREF_STORE_H_ | 6 #define CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PREF_STORE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "chrome/browser/policy/configuration_policy_provider.h" | 13 #include "chrome/browser/policy/configuration_policy_provider.h" |
| 14 #include "chrome/common/pref_store.h" | 14 #include "chrome/common/pref_store.h" |
| 15 | 15 |
| 16 class PrefValueMap; | 16 class PrefValueMap; |
| 17 | 17 |
| 18 namespace policy { | 18 namespace policy { |
| 19 | 19 |
| 20 // Constants for the "Proxy Server Mode" defined in the policies. | |
| 21 // Note that these diverge from internal presentation defined in | |
| 22 // ProxyPrefs::ProxyMode for legacy reasons. The following four | |
| 23 // PolicyProxyModeType types were not very precise and had overlapping use | |
| 24 // cases. | |
| 25 enum PolicyProxyModeType { | |
| 26 // Disable Proxy, connect directly. | |
| 27 kPolicyNoProxyServerMode = 0, | |
| 28 // Auto detect proxy or use specific PAC script if given. | |
| 29 kPolicyAutoDetectProxyServerMode = 1, | |
| 30 // Use manually configured proxy servers (fixed servers). | |
| 31 kPolicyManuallyConfiguredProxyServerMode = 2, | |
| 32 // Use system proxy server. | |
| 33 kPolicyUseSystemProxyServerMode = 3, | |
| 34 | |
| 35 MODE_COUNT | |
| 36 }; | |
| 37 | |
| 38 // An implementation of PrefStore that bridges policy settings as read from a | 20 // An implementation of PrefStore that bridges policy settings as read from a |
| 39 // ConfigurationPolicyProvider to preferences. | 21 // ConfigurationPolicyProvider to preferences. |
| 40 class ConfigurationPolicyPrefStore | 22 class ConfigurationPolicyPrefStore |
| 41 : public PrefStore, | 23 : public PrefStore, |
| 42 public ConfigurationPolicyProvider::Observer { | 24 public ConfigurationPolicyProvider::Observer { |
| 43 public: | 25 public: |
| 44 // The ConfigurationPolicyPrefStore does not take ownership of the | 26 // The ConfigurationPolicyPrefStore does not take ownership of the |
| 45 // passed-in |provider|. | 27 // passed-in |provider|. |
| 46 explicit ConfigurationPolicyPrefStore(ConfigurationPolicyProvider* provider); | 28 explicit ConfigurationPolicyPrefStore(ConfigurationPolicyProvider* provider); |
| 47 virtual ~ConfigurationPolicyPrefStore(); | 29 virtual ~ConfigurationPolicyPrefStore(); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 ObserverList<PrefStore::Observer, true> observers_; | 76 ObserverList<PrefStore::Observer, true> observers_; |
| 95 | 77 |
| 96 ConfigurationPolicyObserverRegistrar registrar_; | 78 ConfigurationPolicyObserverRegistrar registrar_; |
| 97 | 79 |
| 98 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyPrefStore); | 80 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyPrefStore); |
| 99 }; | 81 }; |
| 100 | 82 |
| 101 } // namespace policy | 83 } // namespace policy |
| 102 | 84 |
| 103 #endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PREF_STORE_H_ | 85 #endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PREF_STORE_H_ |
| OLD | NEW |