| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_POLICY_CORE_BROWSER_BROWSER_POLICY_CONNECTOR_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_BROWSER_BROWSER_POLICY_CONNECTOR_H_ |
| 6 #define COMPONENTS_POLICY_CORE_BROWSER_BROWSER_POLICY_CONNECTOR_H_ | 6 #define COMPONENTS_POLICY_CORE_BROWSER_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/scoped_vector.h" | 13 #include "base/memory/scoped_vector.h" |
| 14 #include "components/policy/core/browser/configuration_policy_handler_list.h" | 14 #include "components/policy/core/browser/configuration_policy_handler_list.h" |
| 15 #include "components/policy/core/common/schema.h" | 15 #include "components/policy/core/common/schema.h" |
| 16 #include "components/policy/core/common/schema_registry.h" | 16 #include "components/policy/core/common/schema_registry.h" |
| 17 #include "components/policy/policy_export.h" | 17 #include "components/policy/policy_export.h" |
| 18 | 18 |
| 19 class PrefRegistrySimple; | 19 class PrefRegistrySimple; |
| 20 class PrefService; | 20 class PrefService; |
| 21 | 21 |
| 22 namespace net { | 22 namespace net { |
| 23 class URLRequestContextGetter; | 23 class URLRequestContextGetter; |
| 24 } | 24 } |
| 25 | 25 |
| 26 namespace user_manager { |
| 27 class UserID; |
| 28 } |
| 29 |
| 26 namespace policy { | 30 namespace policy { |
| 27 | 31 |
| 28 class ConfigurationPolicyProvider; | 32 class ConfigurationPolicyProvider; |
| 29 class DeviceManagementService; | 33 class DeviceManagementService; |
| 30 class PolicyService; | 34 class PolicyService; |
| 31 class PolicyStatisticsCollector; | 35 class PolicyStatisticsCollector; |
| 32 | 36 |
| 33 // The BrowserPolicyConnector keeps the browser-global (non Profile-specific) | 37 // The BrowserPolicyConnector keeps the browser-global (non Profile-specific) |
| 34 // policy providers, and some shared components of the policy system. | 38 // policy providers, and some shared components of the policy system. |
| 35 // This is a basic implementation that gets extended by platform-specific | 39 // This is a basic implementation that gets extended by platform-specific |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 // GetPolicyService. This is a static method because local state is | 87 // GetPolicyService. This is a static method because local state is |
| 84 // created immediately after the connector, and tests don't have a chance to | 88 // created immediately after the connector, and tests don't have a chance to |
| 85 // inject the provider otherwise. |provider| must outlive the connector, and | 89 // inject the provider otherwise. |provider| must outlive the connector, and |
| 86 // its ownership is not taken though the connector will initialize and shut it | 90 // its ownership is not taken though the connector will initialize and shut it |
| 87 // down. | 91 // down. |
| 88 static void SetPolicyProviderForTesting( | 92 static void SetPolicyProviderForTesting( |
| 89 ConfigurationPolicyProvider* provider); | 93 ConfigurationPolicyProvider* provider); |
| 90 | 94 |
| 91 // Check whether a user is known to be non-enterprise. Domains such as | 95 // Check whether a user is known to be non-enterprise. Domains such as |
| 92 // gmail.com and googlemail.com are known to not be managed. Also returns | 96 // gmail.com and googlemail.com are known to not be managed. Also returns |
| 93 // false if the username is empty. | 97 // false if the user email is empty. |
| 94 static bool IsNonEnterpriseUser(const std::string& username); | 98 static bool IsNonEnterpriseUser(const user_manager::UserID& user_id); |
| 95 | 99 |
| 96 // Returns the URL for the device management service endpoint. | 100 // Returns the URL for the device management service endpoint. |
| 97 static std::string GetDeviceManagementUrl(); | 101 static std::string GetDeviceManagementUrl(); |
| 98 | 102 |
| 99 // Registers refresh rate prefs. | 103 // Registers refresh rate prefs. |
| 100 static void RegisterPrefs(PrefRegistrySimple* registry); | 104 static void RegisterPrefs(PrefRegistrySimple* registry); |
| 101 | 105 |
| 102 protected: | 106 protected: |
| 103 // Builds an uninitialized BrowserPolicyConnector. | 107 // Builds an uninitialized BrowserPolicyConnector. |
| 104 // Init() should be called to create and start the policy components. | 108 // Init() should be called to create and start the policy components. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 scoped_ptr<PolicyStatisticsCollector> policy_statistics_collector_; | 151 scoped_ptr<PolicyStatisticsCollector> policy_statistics_collector_; |
| 148 | 152 |
| 149 scoped_ptr<DeviceManagementService> device_management_service_; | 153 scoped_ptr<DeviceManagementService> device_management_service_; |
| 150 | 154 |
| 151 DISALLOW_COPY_AND_ASSIGN(BrowserPolicyConnector); | 155 DISALLOW_COPY_AND_ASSIGN(BrowserPolicyConnector); |
| 152 }; | 156 }; |
| 153 | 157 |
| 154 } // namespace policy | 158 } // namespace policy |
| 155 | 159 |
| 156 #endif // COMPONENTS_POLICY_CORE_BROWSER_BROWSER_POLICY_CONNECTOR_H_ | 160 #endif // COMPONENTS_POLICY_CORE_BROWSER_BROWSER_POLICY_CONNECTOR_H_ |
| OLD | NEW |