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_manager_chromeos.h" | 15 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.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 "chrome/browser/policy/cloud/cloud_policy_client.h" | 18 #include "chrome/browser/policy/cloud/cloud_policy_client.h" |
19 #include "chrome/browser/policy/cloud/cloud_policy_store.h" | 19 #include "chrome/browser/policy/cloud/cloud_policy_store.h" |
20 #include "google_apis/gaia/gaia_oauth_client.h" | 20 #include "google_apis/gaia/gaia_oauth_client.h" |
21 | 21 |
22 namespace base { | 22 namespace base { |
23 class SequencedTaskRunner; | 23 class SequencedTaskRunner; |
24 } | 24 } |
25 | 25 |
| 26 namespace chromeos { |
| 27 class DeviceOAuth2TokenService; |
| 28 } |
| 29 |
26 namespace enterprise_management { | 30 namespace enterprise_management { |
27 class PolicyFetchResponse; | 31 class PolicyFetchResponse; |
28 } | 32 } |
29 | 33 |
30 namespace policy { | 34 namespace policy { |
31 | 35 |
32 // Implements the logic that establishes enterprise enrollment for Chromium OS | 36 // Implements the logic that establishes enterprise enrollment for Chromium OS |
33 // devices. The process is as follows: | 37 // devices. The process is as follows: |
34 // 1. Given an auth token, register with the policy service. | 38 // 1. Given an auth token, register with the policy service. |
35 // 2. Download the initial policy blob from the service. | 39 // 2. Download the initial policy blob from the service. |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 DeviceMode device_mode, | 139 DeviceMode device_mode, |
136 const std::string& device_id, | 140 const std::string& device_id, |
137 EnterpriseInstallAttributes::LockResult lock_result); | 141 EnterpriseInstallAttributes::LockResult lock_result); |
138 | 142 |
139 // Drops any ongoing actions. | 143 // Drops any ongoing actions. |
140 void Stop(); | 144 void Stop(); |
141 | 145 |
142 // Reports the result of the enrollment process to the initiator. | 146 // Reports the result of the enrollment process to the initiator. |
143 void ReportResult(EnrollmentStatus status); | 147 void ReportResult(EnrollmentStatus status); |
144 | 148 |
| 149 // Continuation of OnStoreLoaded(). |
| 150 void DidGetTokenService(chromeos::DeviceOAuth2TokenService* token_service); |
| 151 |
145 DeviceCloudPolicyStoreChromeOS* store_; | 152 DeviceCloudPolicyStoreChromeOS* store_; |
146 EnterpriseInstallAttributes* install_attributes_; | 153 EnterpriseInstallAttributes* install_attributes_; |
147 scoped_ptr<CloudPolicyClient> client_; | 154 scoped_ptr<CloudPolicyClient> client_; |
148 scoped_refptr<base::SequencedTaskRunner> background_task_runner_; | 155 scoped_refptr<base::SequencedTaskRunner> background_task_runner_; |
149 scoped_ptr<gaia::GaiaOAuthClient> gaia_oauth_client_; | 156 scoped_ptr<gaia::GaiaOAuthClient> gaia_oauth_client_; |
150 | 157 |
151 std::string auth_token_; | 158 std::string auth_token_; |
152 std::string client_id_; | 159 std::string client_id_; |
153 std::string robot_refresh_token_; | 160 std::string robot_refresh_token_; |
154 bool is_auto_enrollment_; | 161 bool is_auto_enrollment_; |
(...skipping 17 matching lines...) Expand all Loading... |
172 int lockbox_init_duration_; | 179 int lockbox_init_duration_; |
173 | 180 |
174 base::WeakPtrFactory<EnrollmentHandlerChromeOS> weak_factory_; | 181 base::WeakPtrFactory<EnrollmentHandlerChromeOS> weak_factory_; |
175 | 182 |
176 DISALLOW_COPY_AND_ASSIGN(EnrollmentHandlerChromeOS); | 183 DISALLOW_COPY_AND_ASSIGN(EnrollmentHandlerChromeOS); |
177 }; | 184 }; |
178 | 185 |
179 } // namespace policy | 186 } // namespace policy |
180 | 187 |
181 #endif // CHROME_BROWSER_CHROMEOS_POLICY_ENROLLMENT_HANDLER_CHROMEOS_H_ | 188 #endif // CHROME_BROWSER_CHROMEOS_POLICY_ENROLLMENT_HANDLER_CHROMEOS_H_ |
OLD | NEW |