| 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_LOGIN_ENROLLMENT_ENTERPRISE_ENROLLMENT_HELPER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENTERPRISE_ENROLLMENT_HELPER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENTERPRISE_ENROLLMENT_HELPER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENTERPRISE_ENROLLMENT_HELPER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 // allows tests to substitute in a mock enrollment helper. This function will | 81 // allows tests to substitute in a mock enrollment helper. This function will |
| 82 // only be used once. | 82 // only be used once. |
| 83 static void SetupEnrollmentHelperMock(CreateMockEnrollmentHelper creator); | 83 static void SetupEnrollmentHelperMock(CreateMockEnrollmentHelper creator); |
| 84 | 84 |
| 85 virtual ~EnterpriseEnrollmentHelper(); | 85 virtual ~EnterpriseEnrollmentHelper(); |
| 86 | 86 |
| 87 // Starts enterprise enrollment using |auth_code|. First tries to exchange the | 87 // Starts enterprise enrollment using |auth_code|. First tries to exchange the |
| 88 // auth code to authentication token, then tries to enroll the device with the | 88 // auth code to authentication token, then tries to enroll the device with the |
| 89 // received token. | 89 // received token. |
| 90 // If |fetch_additional_token| is true, the helper fetches an additional token | 90 // If |fetch_additional_token| is true, the helper fetches an additional token |
| 91 // and passes it to the |status_consumer| on successfull enrollment. | 91 // and passes it to the |status_consumer| on successful enrollment. |
| 92 // EnrollUsingAuthCode can be called only once during this object's lifetime, | 92 // EnrollUsingAuthCode can be called only once during this object's lifetime, |
| 93 // and only if neither of EnrollUsing* methods was called before. | 93 // and only if neither of EnrollUsing* methods was called before. |
| 94 virtual void EnrollUsingAuthCode(const std::string& auth_code, | 94 virtual void EnrollUsingAuthCode(const std::string& auth_code, |
| 95 bool fetch_additional_token) = 0; | 95 bool fetch_additional_token) = 0; |
| 96 | 96 |
| 97 // Starts enterprise enrollment using |token|. | 97 // Starts enterprise enrollment using |token|. |
| 98 // EnrollUsingToken can be called only once during this object's lifetime, and | 98 // EnrollUsingToken can be called only once during this object's lifetime, and |
| 99 // only if neither of EnrollUsing* was called before. | 99 // only if neither of EnrollUsing* was called before. |
| 100 virtual void EnrollUsingToken(const std::string& token) = 0; | 100 virtual void EnrollUsingToken(const std::string& token) = 0; |
| 101 | 101 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 132 // If this is not nullptr, then it will be used to create the enrollment | 132 // If this is not nullptr, then it will be used to create the enrollment |
| 133 // helper. |create_mock_enrollment_helper_| needs to outlive this class. | 133 // helper. |create_mock_enrollment_helper_| needs to outlive this class. |
| 134 static CreateMockEnrollmentHelper create_mock_enrollment_helper_; | 134 static CreateMockEnrollmentHelper create_mock_enrollment_helper_; |
| 135 | 135 |
| 136 DISALLOW_COPY_AND_ASSIGN(EnterpriseEnrollmentHelper); | 136 DISALLOW_COPY_AND_ASSIGN(EnterpriseEnrollmentHelper); |
| 137 }; | 137 }; |
| 138 | 138 |
| 139 } // namespace chromeos | 139 } // namespace chromeos |
| 140 | 140 |
| 141 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENTERPRISE_ENROLLMENT_HELPER
_H_ | 141 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENTERPRISE_ENROLLMENT_HELPER
_H_ |
| OLD | NEW |