Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper.h

Issue 2677563005: Chromad: Use DM server reply to determine enrollment type (Closed)
Patch Set: comments+create ActiveDirectoryJoinDelegate Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <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/macros.h" 12 #include "base/macros.h"
13 #include "chrome/browser/chromeos/policy/device_cloud_policy_initializer.h" 13 #include "chrome/browser/chromeos/policy/device_cloud_policy_initializer.h"
14 14
15 class GoogleServiceAuthError; 15 class GoogleServiceAuthError;
16 16
17 namespace policy { 17 namespace policy {
18 struct EnrollmentConfig; 18 struct EnrollmentConfig;
19 class EnrollmentStatus; 19 class EnrollmentStatus;
20 } 20 }
21 21
22 namespace chromeos { 22 namespace chromeos {
23 23
24 class ActiveDirectoryJoinDelegate;
25
24 // This class is capable to enroll the device into enterprise domain, using 26 // This class is capable to enroll the device into enterprise domain, using
25 // either a profile containing authentication data or OAuth token. 27 // either a profile containing authentication data or OAuth token.
26 // It can also clear an authentication data from the profile and revoke tokens 28 // It can also clear an authentication data from the profile and revoke tokens
27 // that are not longer needed. 29 // that are not longer needed.
28 class EnterpriseEnrollmentHelper { 30 class EnterpriseEnrollmentHelper {
29 public: 31 public:
30 typedef policy::DeviceCloudPolicyInitializer::EnrollmentCallback 32 typedef policy::DeviceCloudPolicyInitializer::EnrollmentCallback
31 EnrollmentCallback; 33 EnrollmentCallback;
32 34
33 // Enumeration of the possible errors that can occur during enrollment which 35 // Enumeration of the possible errors that can occur during enrollment which
(...skipping 27 matching lines...) Expand all
61 virtual void OnDeviceAttributeUpdatePermission(bool granted) = 0; 63 virtual void OnDeviceAttributeUpdatePermission(bool granted) = 0;
62 64
63 // Called when device attribute upload finishes. |success| indicates 65 // Called when device attribute upload finishes. |success| indicates
64 // whether it is successful or not. 66 // whether it is successful or not.
65 virtual void OnDeviceAttributeUploadCompleted(bool success) = 0; 67 virtual void OnDeviceAttributeUploadCompleted(bool success) = 0;
66 }; 68 };
67 69
68 // Factory method. Caller takes ownership of the returned object. 70 // Factory method. Caller takes ownership of the returned object.
69 static std::unique_ptr<EnterpriseEnrollmentHelper> Create( 71 static std::unique_ptr<EnterpriseEnrollmentHelper> Create(
70 EnrollmentStatusConsumer* status_consumer, 72 EnrollmentStatusConsumer* status_consumer,
73 ActiveDirectoryJoinDelegate* join_delegate,
71 const policy::EnrollmentConfig& enrollment_config, 74 const policy::EnrollmentConfig& enrollment_config,
72 const std::string& enrolling_user_domain); 75 const std::string& enrolling_user_domain);
73 76
74 using CreateMockEnrollmentHelper = EnterpriseEnrollmentHelper* (*)( 77 using CreateMockEnrollmentHelper = EnterpriseEnrollmentHelper* (*)(
75 EnrollmentStatusConsumer* status_consumer, 78 EnrollmentStatusConsumer* status_consumer,
76 const policy::EnrollmentConfig& enrollment_config, 79 const policy::EnrollmentConfig& enrollment_config,
77 const std::string& enrolling_user_domain); 80 const std::string& enrolling_user_domain);
78 81
79 // Use |creator| instead of the default enrollment helper allocator. This 82 // Use |creator| instead of the default enrollment helper allocator. This
80 // allows tests to substitute in a mock enrollment helper. This function will 83 // allows tests to substitute in a mock enrollment helper. This function will
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 // If this is not nullptr, then it will be used to create the enrollment 139 // If this is not nullptr, then it will be used to create the enrollment
137 // helper. |create_mock_enrollment_helper_| needs to outlive this class. 140 // helper. |create_mock_enrollment_helper_| needs to outlive this class.
138 static CreateMockEnrollmentHelper create_mock_enrollment_helper_; 141 static CreateMockEnrollmentHelper create_mock_enrollment_helper_;
139 142
140 DISALLOW_COPY_AND_ASSIGN(EnterpriseEnrollmentHelper); 143 DISALLOW_COPY_AND_ASSIGN(EnterpriseEnrollmentHelper);
141 }; 144 };
142 145
143 } // namespace chromeos 146 } // namespace chromeos
144 147
145 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENTERPRISE_ENROLLMENT_HELPER _H_ 148 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENTERPRISE_ENROLLMENT_HELPER _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698