| 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 CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_CLOUD_POLICY_INITIALIZER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_CLOUD_POLICY_INITIALIZER_H_ | 
| 6 #define CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_CLOUD_POLICY_INITIALIZER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_CLOUD_POLICY_INITIALIZER_H_ | 
| 7 | 7 | 
| 8 #include <bitset> | 8 #include <bitset> | 
|  | 9 #include <memory> | 
| 9 #include <string> | 10 #include <string> | 
| 10 | 11 | 
| 11 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" | 
| 12 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" | 
| 13 #include "base/macros.h" | 14 #include "base/macros.h" | 
| 14 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" | 
| 15 #include "base/memory/scoped_ptr.h" |  | 
| 16 #include "chrome/browser/chromeos/policy/server_backed_state_keys_broker.h" | 16 #include "chrome/browser/chromeos/policy/server_backed_state_keys_broker.h" | 
| 17 #include "components/policy/core/common/cloud/cloud_policy_client.h" | 17 #include "components/policy/core/common/cloud/cloud_policy_client.h" | 
| 18 #include "components/policy/core/common/cloud/cloud_policy_constants.h" | 18 #include "components/policy/core/common/cloud/cloud_policy_constants.h" | 
| 19 #include "components/policy/core/common/cloud/cloud_policy_store.h" | 19 #include "components/policy/core/common/cloud/cloud_policy_store.h" | 
| 20 | 20 | 
| 21 class PrefService; | 21 class PrefService; | 
| 22 | 22 | 
| 23 namespace base { | 23 namespace base { | 
| 24 class SequencedTaskRunner; | 24 class SequencedTaskRunner; | 
| 25 } | 25 } | 
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 92   // CloudPolicyStore::Observer: | 92   // CloudPolicyStore::Observer: | 
| 93   void OnStoreLoaded(CloudPolicyStore* store) override; | 93   void OnStoreLoaded(CloudPolicyStore* store) override; | 
| 94   void OnStoreError(CloudPolicyStore* store) override; | 94   void OnStoreError(CloudPolicyStore* store) override; | 
| 95 | 95 | 
| 96  private: | 96  private: | 
| 97   // Handles completion signaled by |enrollment_handler_|. | 97   // Handles completion signaled by |enrollment_handler_|. | 
| 98   void EnrollmentCompleted(const EnrollmentCallback& enrollment_callback, | 98   void EnrollmentCompleted(const EnrollmentCallback& enrollment_callback, | 
| 99                            EnrollmentStatus status); | 99                            EnrollmentStatus status); | 
| 100 | 100 | 
| 101   // Creates a new CloudPolicyClient. | 101   // Creates a new CloudPolicyClient. | 
| 102   scoped_ptr<CloudPolicyClient> CreateClient( | 102   std::unique_ptr<CloudPolicyClient> CreateClient( | 
| 103       DeviceManagementService* device_management_service); | 103       DeviceManagementService* device_management_service); | 
| 104 | 104 | 
| 105   void TryToCreateClient(); | 105   void TryToCreateClient(); | 
| 106   void StartConnection(scoped_ptr<CloudPolicyClient> client); | 106   void StartConnection(std::unique_ptr<CloudPolicyClient> client); | 
| 107 | 107 | 
| 108   PrefService* local_state_; | 108   PrefService* local_state_; | 
| 109   DeviceManagementService* enterprise_service_; | 109   DeviceManagementService* enterprise_service_; | 
| 110   DeviceManagementService* consumer_service_; | 110   DeviceManagementService* consumer_service_; | 
| 111   scoped_refptr<base::SequencedTaskRunner> background_task_runner_; | 111   scoped_refptr<base::SequencedTaskRunner> background_task_runner_; | 
| 112   EnterpriseInstallAttributes* install_attributes_; | 112   EnterpriseInstallAttributes* install_attributes_; | 
| 113   ServerBackedStateKeysBroker* state_keys_broker_; | 113   ServerBackedStateKeysBroker* state_keys_broker_; | 
| 114   DeviceCloudPolicyStoreChromeOS* device_store_; | 114   DeviceCloudPolicyStoreChromeOS* device_store_; | 
| 115   DeviceCloudPolicyManagerChromeOS* manager_; | 115   DeviceCloudPolicyManagerChromeOS* manager_; | 
| 116   bool is_initialized_; | 116   bool is_initialized_; | 
| 117 | 117 | 
| 118   // Non-NULL if there is an enrollment operation pending. | 118   // Non-NULL if there is an enrollment operation pending. | 
| 119   scoped_ptr<EnrollmentHandlerChromeOS> enrollment_handler_; | 119   std::unique_ptr<EnrollmentHandlerChromeOS> enrollment_handler_; | 
| 120 | 120 | 
| 121   ServerBackedStateKeysBroker::Subscription state_keys_update_subscription_; | 121   ServerBackedStateKeysBroker::Subscription state_keys_update_subscription_; | 
| 122 | 122 | 
| 123   DISALLOW_COPY_AND_ASSIGN(DeviceCloudPolicyInitializer); | 123   DISALLOW_COPY_AND_ASSIGN(DeviceCloudPolicyInitializer); | 
| 124 }; | 124 }; | 
| 125 | 125 | 
| 126 }  // namespace policy | 126 }  // namespace policy | 
| 127 | 127 | 
| 128 #endif  // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_CLOUD_POLICY_INITIALIZER_H_ | 128 #endif  // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_CLOUD_POLICY_INITIALIZER_H_ | 
| OLD | NEW | 
|---|