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_LOGIN_ENROLLMENT_ENROLLMENT_SCREEN_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENROLLMENT_SCREEN_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENROLLMENT_SCREEN_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENROLLMENT_SCREEN_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "base/timer/timer.h" | |
16 #include "chrome/browser/chromeos/login/enrollment/enrollment_screen_actor.h" | 17 #include "chrome/browser/chromeos/login/enrollment/enrollment_screen_actor.h" |
17 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper. h" | 18 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper. h" |
18 #include "chrome/browser/chromeos/login/screens/base_screen.h" | 19 #include "chrome/browser/chromeos/login/screens/base_screen.h" |
19 #include "chrome/browser/chromeos/policy/enrollment_config.h" | 20 #include "chrome/browser/chromeos/policy/enrollment_config.h" |
20 #include "components/policy/core/common/cloud/cloud_policy_constants.h" | 21 #include "components/policy/core/common/cloud/cloud_policy_constants.h" |
21 #include "components/policy/core/common/cloud/enterprise_metrics.h" | 22 #include "components/policy/core/common/cloud/enterprise_metrics.h" |
23 #include "net/base/backoff_entry.h" | |
22 | 24 |
23 namespace base { | 25 namespace base { |
24 class ElapsedTimer; | 26 class ElapsedTimer; |
25 } | 27 } |
26 | 28 |
27 namespace pairing_chromeos { | 29 namespace pairing_chromeos { |
28 class ControllerPairingController; | 30 class ControllerPairingController; |
29 } | 31 } |
30 | 32 |
31 namespace chromeos { | 33 namespace chromeos { |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
139 // Shows the device attribute prompt screen. | 141 // Shows the device attribute prompt screen. |
140 // Used as a callback to run after successful enrollment. | 142 // Used as a callback to run after successful enrollment. |
141 void ShowAttributePromptScreen(); | 143 void ShowAttributePromptScreen(); |
142 | 144 |
143 // Record metrics when we encounter an enrollment error. | 145 // Record metrics when we encounter an enrollment error. |
144 void RecordEnrollmentErrorMetrics(); | 146 void RecordEnrollmentErrorMetrics(); |
145 | 147 |
146 // Advance to the next authentication mechanism if possible. | 148 // Advance to the next authentication mechanism if possible. |
147 bool AdvanceToNextAuth(); | 149 bool AdvanceToNextAuth(); |
148 | 150 |
151 // Similar to OnRetry(), but responds to a timer instead of the user | |
152 // pressing the Retry button. | |
153 void AutomaticRetry(); | |
154 | |
155 // Processes a request to retry enrollment. | |
156 // Called by OnRetry() and AutomaticRetry(). | |
157 void ProcessRetry(); | |
158 | |
149 pairing_chromeos::ControllerPairingController* shark_controller_ = nullptr; | 159 pairing_chromeos::ControllerPairingController* shark_controller_ = nullptr; |
150 | 160 |
151 EnrollmentScreenActor* actor_; | 161 EnrollmentScreenActor* actor_; |
152 policy::EnrollmentConfig config_; | 162 policy::EnrollmentConfig config_; |
153 policy::EnrollmentConfig enrollment_config_; | 163 policy::EnrollmentConfig enrollment_config_; |
154 Auth current_auth_ = AUTH_OAUTH; | 164 Auth current_auth_ = AUTH_OAUTH; |
155 Auth last_auth_ = AUTH_OAUTH; | 165 Auth last_auth_ = AUTH_OAUTH; |
156 bool enrollment_failed_once_ = false; | 166 bool enrollment_failed_once_ = false; |
157 std::string enrolling_user_domain_; | 167 std::string enrolling_user_domain_; |
158 std::string auth_code_; | 168 std::string auth_code_; |
159 std::unique_ptr<base::ElapsedTimer> elapsed_timer_; | 169 std::unique_ptr<base::ElapsedTimer> elapsed_timer_; |
170 base::OneShotTimer retry_timer_; | |
The one and only Dr. Crash
2016/12/06 22:24:33
Instead of using a timer, you can simply post dela
| |
171 net::BackoffEntry::Policy retry_policy_; | |
172 net::BackoffEntry retry_backoff_; | |
173 int num_retries_; | |
160 std::unique_ptr<EnterpriseEnrollmentHelper> enrollment_helper_; | 174 std::unique_ptr<EnterpriseEnrollmentHelper> enrollment_helper_; |
161 base::WeakPtrFactory<EnrollmentScreen> weak_ptr_factory_; | 175 base::WeakPtrFactory<EnrollmentScreen> weak_ptr_factory_; |
162 | 176 |
163 DISALLOW_COPY_AND_ASSIGN(EnrollmentScreen); | 177 DISALLOW_COPY_AND_ASSIGN(EnrollmentScreen); |
164 }; | 178 }; |
165 | 179 |
166 } // namespace chromeos | 180 } // namespace chromeos |
167 | 181 |
168 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENROLLMENT_SCREEN_H_ | 182 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENROLLMENT_SCREEN_H_ |
OLD | NEW |