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

Side by Side Diff: chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_impl.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_IM PL_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENTERPRISE_ENROLLMENT_HELPER_IM PL_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENTERPRISE_ENROLLMENT_HELPER_IM PL_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENTERPRISE_ENROLLMENT_HELPER_IM PL_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/gtest_prod_util.h" 12 #include "base/gtest_prod_util.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper. h" 15 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper. h"
16 #include "chrome/browser/chromeos/policy/enrollment_config.h" 16 #include "chrome/browser/chromeos/policy/enrollment_config.h"
17 #include "components/policy/core/common/cloud/enterprise_metrics.h" 17 #include "components/policy/core/common/cloud/enterprise_metrics.h"
18 #include "google_apis/gaia/google_service_auth_error.h" 18 #include "google_apis/gaia/google_service_auth_error.h"
19 19
20 namespace policy { 20 namespace policy {
21 class PolicyOAuth2TokenFetcher; 21 class PolicyOAuth2TokenFetcher;
22 } 22 }
23 23
24 namespace chromeos { 24 namespace chromeos {
25 25
26 class EnterpriseEnrollmentHelperImpl : public EnterpriseEnrollmentHelper { 26 class EnterpriseEnrollmentHelperImpl : public EnterpriseEnrollmentHelper {
27 public: 27 public:
28 EnterpriseEnrollmentHelperImpl( 28 EnterpriseEnrollmentHelperImpl(
29 EnrollmentStatusConsumer* status_consumer, 29 EnrollmentStatusConsumer* status_consumer,
30 ActiveDirectoryJoinDelegate* join_delegate,
achuithb 2017/02/13 13:39:02 ad_join_delegate here and everywhere else?
Roman Sorokin (ftl) 2017/02/14 12:47:10 Done.
30 const policy::EnrollmentConfig& enrollment_config, 31 const policy::EnrollmentConfig& enrollment_config,
31 const std::string& enrolling_user_domain); 32 const std::string& enrolling_user_domain);
32 ~EnterpriseEnrollmentHelperImpl() override; 33 ~EnterpriseEnrollmentHelperImpl() override;
33 34
34 // Overridden from EnterpriseEnrollmentHelper: 35 // Overridden from EnterpriseEnrollmentHelper:
35 void EnrollUsingAuthCode(const std::string& auth_code, 36 void EnrollUsingAuthCode(const std::string& auth_code,
36 bool fetch_additional_token) override; 37 bool fetch_additional_token) override;
37 void EnrollUsingToken(const std::string& token) override; 38 void EnrollUsingToken(const std::string& token) override;
38 void EnrollUsingAttestation() override; 39 void EnrollUsingAttestation() override;
39 void ClearAuth(const base::Closure& callback) override; 40 void ClearAuth(const base::Closure& callback) override;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 std::string additional_token_; 82 std::string additional_token_;
82 enum { 83 enum {
83 OAUTH_NOT_STARTED, 84 OAUTH_NOT_STARTED,
84 OAUTH_STARTED_WITH_AUTH_CODE, 85 OAUTH_STARTED_WITH_AUTH_CODE,
85 OAUTH_STARTED_WITH_TOKEN, 86 OAUTH_STARTED_WITH_TOKEN,
86 OAUTH_FINISHED 87 OAUTH_FINISHED
87 } oauth_status_ = OAUTH_NOT_STARTED; 88 } oauth_status_ = OAUTH_NOT_STARTED;
88 bool oauth_data_cleared_ = false; 89 bool oauth_data_cleared_ = false;
89 std::string oauth_token_; 90 std::string oauth_token_;
90 bool success_ = false; 91 bool success_ = false;
92 ActiveDirectoryJoinDelegate* join_delegate_;
achuithb 2017/02/13 13:39:02 ad_join_delegate_? Also, initialize to nullptr fo
Roman Sorokin (ftl) 2017/02/14 12:47:10 Done.
91 93
92 std::unique_ptr<policy::PolicyOAuth2TokenFetcher> oauth_fetcher_; 94 std::unique_ptr<policy::PolicyOAuth2TokenFetcher> oauth_fetcher_;
93 95
94 base::WeakPtrFactory<EnterpriseEnrollmentHelperImpl> weak_ptr_factory_; 96 base::WeakPtrFactory<EnterpriseEnrollmentHelperImpl> weak_ptr_factory_;
95 97
96 DISALLOW_COPY_AND_ASSIGN(EnterpriseEnrollmentHelperImpl); 98 DISALLOW_COPY_AND_ASSIGN(EnterpriseEnrollmentHelperImpl);
97 }; 99 };
98 100
99 } // namespace chromeos 101 } // namespace chromeos
100 102
101 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENTERPRISE_ENROLLMENT_HELPER _IMPL_H_ 103 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENTERPRISE_ENROLLMENT_HELPER _IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698