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_BROWSER_POLICY_CONNECTOR_H_ | 5 #ifndef CHROME_BROWSER_POLICY_BROWSER_POLICY_CONNECTOR_H_ |
6 #define CHROME_BROWSER_POLICY_BROWSER_POLICY_CONNECTOR_H_ | 6 #define CHROME_BROWSER_POLICY_BROWSER_POLICY_CONNECTOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "chrome/browser/policy/cloud/cloud_policy_constants.h" | 14 #include "chrome/browser/policy/cloud/cloud_policy_constants.h" |
15 #include "chrome/browser/policy/configuration_policy_handler_list.h" | 15 #include "chrome/browser/policy/configuration_policy_handler_list.h" |
16 | 16 |
17 #if defined(OS_CHROMEOS) | 17 #if defined(OS_CHROMEOS) |
18 #include "chrome/browser/chromeos/policy/proxy_policy_provider.h" | 18 #include "chrome/browser/chromeos/policy/proxy_policy_provider.h" |
19 #endif | 19 #endif |
20 | 20 |
21 class PrefRegistrySimple; | 21 class PrefRegistrySimple; |
| 22 class PrefRegistrySyncable; |
22 class PrefService; | 23 class PrefService; |
23 class Profile; | 24 class Profile; |
24 | 25 |
25 namespace net { | 26 namespace net { |
26 class URLRequestContextGetter; | 27 class URLRequestContextGetter; |
27 } | 28 } |
28 | 29 |
29 namespace policy { | 30 namespace policy { |
30 | 31 |
31 class ConfigurationPolicyProvider; | 32 class ConfigurationPolicyProvider; |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 | 150 |
150 // Gets the URL of the DM server (either the default or a URL provided via the | 151 // Gets the URL of the DM server (either the default or a URL provided via the |
151 // command line). | 152 // command line). |
152 static std::string GetDeviceManagementUrl(); | 153 static std::string GetDeviceManagementUrl(); |
153 | 154 |
154 // Check whether a user is known to be non-enterprise. Domains such as | 155 // Check whether a user is known to be non-enterprise. Domains such as |
155 // gmail.com and googlemail.com are known to not be managed. Also returns | 156 // gmail.com and googlemail.com are known to not be managed. Also returns |
156 // false if the username is empty. | 157 // false if the username is empty. |
157 static bool IsNonEnterpriseUser(const std::string& username); | 158 static bool IsNonEnterpriseUser(const std::string& username); |
158 | 159 |
| 160 // Returns true if |profile| has used certificates installed via policy |
| 161 // to establish a secure connection before. This means that it may have |
| 162 // cached content from an untrusted source. |
| 163 static bool UsedPolicyCertificates(Profile* profile); |
| 164 |
159 // Registers refresh rate prefs. | 165 // Registers refresh rate prefs. |
160 static void RegisterPrefs(PrefRegistrySimple* registry); | 166 static void RegisterPrefs(PrefRegistrySimple* registry); |
161 | 167 |
| 168 // Registers Profile prefs related to policy features. |
| 169 static void RegisterUserPrefs(PrefRegistrySyncable* registry); |
| 170 |
162 private: | 171 private: |
163 // Set the timezone as soon as the policies are available. | 172 // Set the timezone as soon as the policies are available. |
164 void SetTimezoneIfPolicyAvailable(); | 173 void SetTimezoneIfPolicyAvailable(); |
165 | 174 |
166 // Creates a new PolicyService with the shared policy providers and the given | 175 // Creates a new PolicyService with the shared policy providers and the given |
167 // |user_cloud_policy_provider| and |managed_mode_policy_provider|, which are | 176 // |user_cloud_policy_provider| and |managed_mode_policy_provider|, which are |
168 // optional. | 177 // optional. |
169 scoped_ptr<PolicyService> CreatePolicyServiceWithProviders( | 178 scoped_ptr<PolicyService> CreatePolicyServiceWithProviders( |
170 ConfigurationPolicyProvider* user_cloud_policy_provider, | 179 ConfigurationPolicyProvider* user_cloud_policy_provider, |
171 ConfigurationPolicyProvider* managed_mode_policy_provider); | 180 ConfigurationPolicyProvider* managed_mode_policy_provider); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 scoped_ptr<AppPackUpdater> app_pack_updater_; | 229 scoped_ptr<AppPackUpdater> app_pack_updater_; |
221 scoped_ptr<NetworkConfigurationUpdater> network_configuration_updater_; | 230 scoped_ptr<NetworkConfigurationUpdater> network_configuration_updater_; |
222 #endif | 231 #endif |
223 | 232 |
224 DISALLOW_COPY_AND_ASSIGN(BrowserPolicyConnector); | 233 DISALLOW_COPY_AND_ASSIGN(BrowserPolicyConnector); |
225 }; | 234 }; |
226 | 235 |
227 } // namespace policy | 236 } // namespace policy |
228 | 237 |
229 #endif // CHROME_BROWSER_POLICY_BROWSER_POLICY_CONNECTOR_H_ | 238 #endif // CHROME_BROWSER_POLICY_BROWSER_POLICY_CONNECTOR_H_ |
OLD | NEW |