| Index: chrome/browser/policy/browser_policy_connector.h
|
| diff --git a/chrome/browser/policy/browser_policy_connector.h b/chrome/browser/policy/browser_policy_connector.h
|
| index 047eaf8903fcd36c38f63a9edf2b6d1440c2dc8c..8a95e429b786a791dd2b188bed8eb23794c125fc 100644
|
| --- a/chrome/browser/policy/browser_policy_connector.h
|
| +++ b/chrome/browser/policy/browser_policy_connector.h
|
| @@ -12,36 +12,31 @@
|
| #include "base/memory/weak_ptr.h"
|
| #include "chrome/browser/policy/cloud_policy_constants.h"
|
| #include "chrome/browser/policy/configuration_policy_handler_list.h"
|
| -#include "chrome/browser/policy/enterprise_install_attributes.h"
|
| #include "chrome/browser/policy/proxy_policy_provider.h"
|
| -#include "content/public/browser/notification_observer.h"
|
| -#include "content/public/browser/notification_registrar.h"
|
|
|
| +class PrefServiceSimple;
|
| class Profile;
|
| -class TokenService;
|
|
|
| namespace policy {
|
|
|
| -class AppPackUpdater;
|
| -class CloudPolicyDataStore;
|
| -class CloudPolicyProvider;
|
| -class CloudPolicySubsystem;
|
| class ConfigurationPolicyProvider;
|
| +class DeviceManagementService;
|
| +class PolicyService;
|
| +class PolicyStatisticsCollector;
|
| +
|
| +#if defined(OS_CHROMEOS)
|
| +class AppPackUpdater;
|
| class DeviceCloudPolicyManagerChromeOS;
|
| class DeviceLocalAccountPolicyProvider;
|
| class DeviceLocalAccountPolicyService;
|
| -class DeviceManagementService;
|
| +class EnterpriseInstallAttributes;
|
| class NetworkConfigurationUpdater;
|
| -class PolicyService;
|
| -class PolicyStatisticsCollector;
|
| class UserCloudPolicyManagerChromeOS;
|
| -class UserPolicyTokenCache;
|
| +#endif
|
|
|
| // Manages the lifecycle of browser-global policy infrastructure, such as the
|
| // platform policy providers, device- and the user-cloud policy infrastructure.
|
| -// TODO(gfeher,mnissler): Factor out device and user specific methods into their
|
| -// respective classes.
|
| -class BrowserPolicyConnector : public content::NotificationObserver {
|
| +class BrowserPolicyConnector {
|
| public:
|
| // Builds an uninitialized BrowserPolicyConnector, suitable for testing.
|
| // Init() should be called to create and start the policy machinery.
|
| @@ -71,41 +66,11 @@ class BrowserPolicyConnector : public content::NotificationObserver {
|
| // whole browser.
|
| PolicyService* GetPolicyService();
|
|
|
| - // Returns a weak pointer to the CloudPolicySubsystem corresponding to the
|
| - // device policy managed by this policy connector, or NULL if no such
|
| - // subsystem exists (i.e. when running outside ChromeOS).
|
| - CloudPolicySubsystem* device_cloud_policy_subsystem() {
|
| #if defined(OS_CHROMEOS)
|
| - return device_cloud_policy_subsystem_.get();
|
| -#else
|
| - return NULL;
|
| -#endif
|
| - }
|
| -
|
| - // Returns a weak pointer to the CloudPolicySubsystem corresponding to the
|
| - // user policy managed by this policy connector, or NULL if no such
|
| - // subsystem exists (i.e. when user cloud policy is not active due to
|
| - // unmanaged or not logged in).
|
| - CloudPolicySubsystem* user_cloud_policy_subsystem() {
|
| - return user_cloud_policy_subsystem_.get();
|
| - }
|
| -
|
| - // Triggers registration for device policy, using the |owner_email| account.
|
| - // |token| is an oauth token to authenticate the registration request, and
|
| - // |known_machine_id| is true if the server should do additional checks based
|
| - // on the machine_id used for the request.
|
| - void RegisterForDevicePolicy(const std::string& owner_email,
|
| - const std::string& token,
|
| - bool known_machine_id,
|
| - bool reregister);
|
| -
|
| // Returns true if this device is managed by an enterprise (as opposed to
|
| // a local owner).
|
| bool IsEnterpriseManaged();
|
|
|
| - // Locks the device to an enterprise domain.
|
| - EnterpriseInstallAttributes::LockResult LockDevice(const std::string& user);
|
| -
|
| // Returns the enterprise domain if device is managed.
|
| std::string GetEnterpriseDomain();
|
|
|
| @@ -114,19 +79,13 @@ class BrowserPolicyConnector : public content::NotificationObserver {
|
| // locked empty, or DEVICE_MODE_UNKNOWN if the device has not been owned yet.
|
| // For other OSes the function will always return DEVICE_MODE_CONSUMER.
|
| DeviceMode GetDeviceMode();
|
| -
|
| - // Reset the device policy machinery. This stops any automatic retry behavior
|
| - // and clears the error flags, so potential retries have a chance to succeed.
|
| - void ResetDevicePolicy();
|
| -
|
| - // Initiates device and user policy fetches, if possible. Pending fetches
|
| - // will be cancelled.
|
| - void FetchCloudPolicy();
|
| +#endif
|
|
|
| // Schedules initialization of the cloud policy backend services, if the
|
| // services are already constructed.
|
| void ScheduleServiceInitialization(int64 delay_milliseconds);
|
|
|
| +#if defined(OS_CHROMEOS)
|
| // Initializes the user cloud policy infrastructure.
|
| // If |wait_for_policy_fetch| is true, the user policy will only become fully
|
| // initialized after a policy fetch is attempted. Note that Profile creation
|
| @@ -134,20 +93,7 @@ class BrowserPolicyConnector : public content::NotificationObserver {
|
| void InitializeUserPolicy(const std::string& user_name,
|
| bool is_public_account,
|
| bool wait_for_policy_fetch);
|
| -
|
| - // Installs a token service for user policy.
|
| - void SetUserPolicyTokenService(TokenService* token_service);
|
| -
|
| - // Registers for user policy (if not already registered), using the passed
|
| - // OAuth V2 token for authentication. |oauth_token| can be empty to signal
|
| - // that an attempt to fetch the token was made but failed, or that oauth
|
| - // isn't being used.
|
| - void RegisterForUserPolicy(const std::string& oauth_token);
|
| -
|
| - // The data stores should be considered read-only for everyone except for
|
| - // tests.
|
| - CloudPolicyDataStore* GetDeviceCloudPolicyDataStore();
|
| - CloudPolicyDataStore* GetUserCloudPolicyDataStore();
|
| +#endif
|
|
|
| const ConfigurationPolicyHandlerList* GetHandlerList() const;
|
|
|
| @@ -155,15 +101,15 @@ class BrowserPolicyConnector : public content::NotificationObserver {
|
| // the installation attributes.
|
| UserAffiliation GetUserAffiliation(const std::string& user_name);
|
|
|
| - AppPackUpdater* GetAppPackUpdater();
|
| -
|
| - NetworkConfigurationUpdater* GetNetworkConfigurationUpdater();
|
| -
|
| DeviceManagementService* device_management_service() {
|
| return device_management_service_.get();
|
| }
|
|
|
| #if defined(OS_CHROMEOS)
|
| + AppPackUpdater* GetAppPackUpdater();
|
| +
|
| + NetworkConfigurationUpdater* GetNetworkConfigurationUpdater();
|
| +
|
| DeviceCloudPolicyManagerChromeOS* GetDeviceCloudPolicyManager() {
|
| return device_cloud_policy_manager_.get();
|
| }
|
| @@ -201,15 +147,10 @@ class BrowserPolicyConnector : public content::NotificationObserver {
|
| // false if the username is empty.
|
| static bool IsNonEnterpriseUser(const std::string& username);
|
|
|
| - private:
|
| - // content::NotificationObserver method overrides:
|
| - virtual void Observe(int type,
|
| - const content::NotificationSource& source,
|
| - const content::NotificationDetails& details) OVERRIDE;
|
| -
|
| - // Initializes the device cloud policy infrasturcture.
|
| - void InitializeDevicePolicy();
|
| + // Registers refresh rate prefs.
|
| + static void RegisterPrefs(PrefServiceSimple* local_state);
|
|
|
| + private:
|
| // Complete initialization once the message loops are running and the
|
| // local_state is initialized.
|
| void CompleteInitialization();
|
| @@ -236,7 +177,6 @@ class BrowserPolicyConnector : public content::NotificationObserver {
|
| ConfigurationPolicyHandlerList handler_list_;
|
|
|
| scoped_ptr<ConfigurationPolicyProvider> platform_provider_;
|
| - scoped_ptr<CloudPolicyProvider> cloud_provider_;
|
|
|
| // Components of the new-style cloud policy implementation.
|
| // TODO(mnissler): Remove the old-style components below once we have
|
| @@ -260,15 +200,6 @@ class BrowserPolicyConnector : public content::NotificationObserver {
|
| // Must be deleted before all the policy providers.
|
| scoped_ptr<PolicyService> policy_service_;
|
|
|
| -#if defined(OS_CHROMEOS)
|
| - scoped_ptr<CloudPolicyDataStore> device_data_store_;
|
| - scoped_ptr<CloudPolicySubsystem> device_cloud_policy_subsystem_;
|
| -#endif
|
| -
|
| - scoped_ptr<UserPolicyTokenCache> user_policy_token_cache_;
|
| - scoped_ptr<CloudPolicyDataStore> user_data_store_;
|
| - scoped_ptr<CloudPolicySubsystem> user_cloud_policy_subsystem_;
|
| -
|
| scoped_ptr<PolicyStatisticsCollector> policy_statistics_collector_;
|
|
|
| scoped_ptr<DeviceManagementService> device_management_service_;
|
| @@ -277,13 +208,6 @@ class BrowserPolicyConnector : public content::NotificationObserver {
|
| // are spinning.
|
| base::WeakPtrFactory<BrowserPolicyConnector> weak_ptr_factory_;
|
|
|
| - // Registers the provider for notification of successful Gaia logins.
|
| - content::NotificationRegistrar registrar_;
|
| -
|
| - // Weak reference to the TokenService we are listening to for user cloud
|
| - // policy authentication tokens.
|
| - TokenService* token_service_;
|
| -
|
| #if defined(OS_CHROMEOS)
|
| scoped_ptr<AppPackUpdater> app_pack_updater_;
|
| scoped_ptr<NetworkConfigurationUpdater> network_configuration_updater_;
|
|
|