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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 // EnrollUsingToken can be called only once during this object's lifetime, and | 89 // EnrollUsingToken can be called only once during this object's lifetime, and |
90 // only if neither of EnrollUsing* was called before. | 90 // only if neither of EnrollUsing* was called before. |
91 virtual void EnrollUsingToken(const std::string& token) = 0; | 91 virtual void EnrollUsingToken(const std::string& token) = 0; |
92 | 92 |
93 // Clears authentication data from the profile (if EnrollUsingProfile was | 93 // Clears authentication data from the profile (if EnrollUsingProfile was |
94 // used) and revokes fetched tokens. | 94 // used) and revokes fetched tokens. |
95 // Does not revoke the additional token if enrollment finished successfully. | 95 // Does not revoke the additional token if enrollment finished successfully. |
96 // Calls |callback| on completion. | 96 // Calls |callback| on completion. |
97 virtual void ClearAuth(const base::Closure& callback) = 0; | 97 virtual void ClearAuth(const base::Closure& callback) = 0; |
98 | 98 |
| 99 // Gets oauth token, used during enterprise enrollment. |
| 100 virtual const std::string& GetOAuthToken() = 0; |
| 101 |
99 protected: | 102 protected: |
100 // |status_consumer| must outlive |this|. Moreover, the user of this class | 103 // |status_consumer| must outlive |this|. Moreover, the user of this class |
101 // is responsible for clearing auth data in some cases (see comment for | 104 // is responsible for clearing auth data in some cases (see comment for |
102 // EnrollUsingProfile()). | 105 // EnrollUsingProfile()). |
103 explicit EnterpriseEnrollmentHelper( | 106 explicit EnterpriseEnrollmentHelper( |
104 EnrollmentStatusConsumer* status_consumer); | 107 EnrollmentStatusConsumer* status_consumer); |
105 | 108 |
106 EnrollmentStatusConsumer* status_consumer() { return status_consumer_; } | 109 EnrollmentStatusConsumer* status_consumer() { return status_consumer_; } |
107 | 110 |
108 private: | 111 private: |
109 EnrollmentStatusConsumer* status_consumer_; | 112 EnrollmentStatusConsumer* status_consumer_; |
110 | 113 |
111 DISALLOW_COPY_AND_ASSIGN(EnterpriseEnrollmentHelper); | 114 DISALLOW_COPY_AND_ASSIGN(EnterpriseEnrollmentHelper); |
112 }; | 115 }; |
113 | 116 |
114 } // namespace chromeos | 117 } // namespace chromeos |
115 | 118 |
116 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENTERPRISE_ENROLLMENT_HELPER
_H_ | 119 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENTERPRISE_ENROLLMENT_HELPER
_H_ |
OLD | NEW |