| 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_CHROMEOS_POLICY_ENROLLMENT_HANDLER_CHROMEOS_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_ENROLLMENT_HANDLER_CHROMEOS_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_POLICY_ENROLLMENT_HANDLER_CHROMEOS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_ENROLLMENT_HANDLER_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "chrome/browser/chromeos/policy/device_cloud_policy_initializer.h" | 15 #include "chrome/browser/chromeos/policy/device_cloud_policy_initializer.h" |
| 16 #include "chrome/browser/chromeos/policy/device_cloud_policy_validator.h" | 16 #include "chrome/browser/chromeos/policy/device_cloud_policy_validator.h" |
| 17 #include "chrome/browser/chromeos/policy/enterprise_install_attributes.h" | 17 #include "chrome/browser/chromeos/policy/enterprise_install_attributes.h" |
| 18 #include "components/policy/core/common/cloud/cloud_policy_client.h" | 18 #include "components/policy/core/common/cloud/cloud_policy_client.h" |
| 19 #include "components/policy/core/common/cloud/cloud_policy_constants.h" |
| 19 #include "components/policy/core/common/cloud/cloud_policy_store.h" | 20 #include "components/policy/core/common/cloud/cloud_policy_store.h" |
| 20 #include "google_apis/gaia/gaia_oauth_client.h" | 21 #include "google_apis/gaia/gaia_oauth_client.h" |
| 21 #include "policy/proto/device_management_backend.pb.h" | 22 #include "policy/proto/device_management_backend.pb.h" |
| 22 | 23 |
| 23 namespace base { | 24 namespace base { |
| 24 class SequencedTaskRunner; | 25 class SequencedTaskRunner; |
| 25 } | 26 } |
| 26 | 27 |
| 27 namespace chromeos { | 28 namespace chromeos { |
| 28 class DeviceSettingsService; | 29 class DeviceSettingsService; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 EnterpriseInstallAttributes* install_attributes, | 65 EnterpriseInstallAttributes* install_attributes, |
| 65 ServerBackedStateKeysBroker* state_keys_broker, | 66 ServerBackedStateKeysBroker* state_keys_broker, |
| 66 chromeos::DeviceSettingsService* device_settings_service, | 67 chromeos::DeviceSettingsService* device_settings_service, |
| 67 scoped_ptr<CloudPolicyClient> client, | 68 scoped_ptr<CloudPolicyClient> client, |
| 68 scoped_refptr<base::SequencedTaskRunner> background_task_runner, | 69 scoped_refptr<base::SequencedTaskRunner> background_task_runner, |
| 69 const std::string& auth_token, | 70 const std::string& auth_token, |
| 70 const std::string& client_id, | 71 const std::string& client_id, |
| 71 bool is_auto_enrollment, | 72 bool is_auto_enrollment, |
| 72 const std::string& requisition, | 73 const std::string& requisition, |
| 73 const AllowedDeviceModes& allowed_device_modes, | 74 const AllowedDeviceModes& allowed_device_modes, |
| 74 enterprise_management::PolicyData::ManagementMode management_mode, | 75 ManagementMode management_mode, |
| 75 const EnrollmentCallback& completion_callback); | 76 const EnrollmentCallback& completion_callback); |
| 76 virtual ~EnrollmentHandlerChromeOS(); | 77 virtual ~EnrollmentHandlerChromeOS(); |
| 77 | 78 |
| 78 // Starts the enrollment process and reports the result to | 79 // Starts the enrollment process and reports the result to |
| 79 // |completion_callback_|. | 80 // |completion_callback_|. |
| 80 void StartEnrollment(); | 81 void StartEnrollment(); |
| 81 | 82 |
| 82 // Releases the client. | 83 // Releases the client. |
| 83 scoped_ptr<CloudPolicyClient> ReleaseClient(); | 84 scoped_ptr<CloudPolicyClient> ReleaseClient(); |
| 84 | 85 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 scoped_refptr<base::SequencedTaskRunner> background_task_runner_; | 164 scoped_refptr<base::SequencedTaskRunner> background_task_runner_; |
| 164 scoped_ptr<gaia::GaiaOAuthClient> gaia_oauth_client_; | 165 scoped_ptr<gaia::GaiaOAuthClient> gaia_oauth_client_; |
| 165 | 166 |
| 166 std::string auth_token_; | 167 std::string auth_token_; |
| 167 std::string client_id_; | 168 std::string client_id_; |
| 168 bool is_auto_enrollment_; | 169 bool is_auto_enrollment_; |
| 169 std::string requisition_; | 170 std::string requisition_; |
| 170 std::string current_state_key_; | 171 std::string current_state_key_; |
| 171 std::string refresh_token_; | 172 std::string refresh_token_; |
| 172 AllowedDeviceModes allowed_device_modes_; | 173 AllowedDeviceModes allowed_device_modes_; |
| 173 enterprise_management::PolicyData::ManagementMode management_mode_; | 174 ManagementMode management_mode_; |
| 174 EnrollmentCallback completion_callback_; | 175 EnrollmentCallback completion_callback_; |
| 175 | 176 |
| 176 // The device mode as received in the registration request. | 177 // The device mode as received in the registration request. |
| 177 DeviceMode device_mode_; | 178 DeviceMode device_mode_; |
| 178 | 179 |
| 179 // The validated policy response info to be installed in the store. | 180 // The validated policy response info to be installed in the store. |
| 180 scoped_ptr<enterprise_management::PolicyFetchResponse> policy_; | 181 scoped_ptr<enterprise_management::PolicyFetchResponse> policy_; |
| 181 std::string username_; | 182 std::string username_; |
| 182 std::string device_id_; | 183 std::string device_id_; |
| 183 std::string request_token_; | 184 std::string request_token_; |
| 184 | 185 |
| 185 // Current enrollment step. | 186 // Current enrollment step. |
| 186 EnrollmentStep enrollment_step_; | 187 EnrollmentStep enrollment_step_; |
| 187 | 188 |
| 188 // Total amount of time in milliseconds spent waiting for lockbox | 189 // Total amount of time in milliseconds spent waiting for lockbox |
| 189 // initialization. | 190 // initialization. |
| 190 int lockbox_init_duration_; | 191 int lockbox_init_duration_; |
| 191 | 192 |
| 192 base::WeakPtrFactory<EnrollmentHandlerChromeOS> weak_ptr_factory_; | 193 base::WeakPtrFactory<EnrollmentHandlerChromeOS> weak_ptr_factory_; |
| 193 | 194 |
| 194 DISALLOW_COPY_AND_ASSIGN(EnrollmentHandlerChromeOS); | 195 DISALLOW_COPY_AND_ASSIGN(EnrollmentHandlerChromeOS); |
| 195 }; | 196 }; |
| 196 | 197 |
| 197 } // namespace policy | 198 } // namespace policy |
| 198 | 199 |
| 199 #endif // CHROME_BROWSER_CHROMEOS_POLICY_ENROLLMENT_HANDLER_CHROMEOS_H_ | 200 #endif // CHROME_BROWSER_CHROMEOS_POLICY_ENROLLMENT_HANDLER_CHROMEOS_H_ |
| OLD | NEW |