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

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

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 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper. h" 5 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper. h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_ impl.h" 9 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_ impl.h"
10 10
11 namespace chromeos { 11 namespace chromeos {
12 12
13 EnterpriseEnrollmentHelper::CreateMockEnrollmentHelper 13 EnterpriseEnrollmentHelper::CreateMockEnrollmentHelper
14 EnterpriseEnrollmentHelper::create_mock_enrollment_helper_ = nullptr; 14 EnterpriseEnrollmentHelper::create_mock_enrollment_helper_ = nullptr;
15 15
16 EnterpriseEnrollmentHelper::~EnterpriseEnrollmentHelper() { 16 EnterpriseEnrollmentHelper::~EnterpriseEnrollmentHelper() {
17 } 17 }
18 18
19 // static 19 // static
20 void EnterpriseEnrollmentHelper::SetupEnrollmentHelperMock( 20 void EnterpriseEnrollmentHelper::SetupEnrollmentHelperMock(
21 CreateMockEnrollmentHelper creator) { 21 CreateMockEnrollmentHelper creator) {
22 create_mock_enrollment_helper_ = creator; 22 create_mock_enrollment_helper_ = creator;
23 } 23 }
24 24
25 // static 25 // static
26 std::unique_ptr<EnterpriseEnrollmentHelper> EnterpriseEnrollmentHelper::Create( 26 std::unique_ptr<EnterpriseEnrollmentHelper> EnterpriseEnrollmentHelper::Create(
27 EnrollmentStatusConsumer* status_consumer, 27 EnrollmentStatusConsumer* status_consumer,
28 ActiveDirectoryJoinDelegate* join_delegate,
28 const policy::EnrollmentConfig& enrollment_config, 29 const policy::EnrollmentConfig& enrollment_config,
29 const std::string& enrolling_user_domain) { 30 const std::string& enrolling_user_domain) {
30 // Create a mock instance. 31 // Create a mock instance.
31 if (create_mock_enrollment_helper_) { 32 if (create_mock_enrollment_helper_) {
32 // The evaluated code might call |SetupEnrollmentHelperMock| to setup a new 33 // The evaluated code might call |SetupEnrollmentHelperMock| to setup a new
33 // allocator, so we reset the enrollment helper to null before that. 34 // allocator, so we reset the enrollment helper to null before that.
34 auto enrollment_helper_allocator = create_mock_enrollment_helper_; 35 auto enrollment_helper_allocator = create_mock_enrollment_helper_;
35 create_mock_enrollment_helper_ = nullptr; 36 create_mock_enrollment_helper_ = nullptr;
36 EnterpriseEnrollmentHelper* helper = enrollment_helper_allocator( 37 EnterpriseEnrollmentHelper* helper = enrollment_helper_allocator(
37 status_consumer, enrollment_config, enrolling_user_domain); 38 status_consumer, enrollment_config, enrolling_user_domain);
38 return base::WrapUnique(helper); 39 return base::WrapUnique(helper);
39 } 40 }
40 41
41 return base::WrapUnique(new EnterpriseEnrollmentHelperImpl( 42 return base::WrapUnique(new EnterpriseEnrollmentHelperImpl(
42 status_consumer, enrollment_config, enrolling_user_domain)); 43 status_consumer, join_delegate, enrollment_config,
44 enrolling_user_domain));
43 } 45 }
44 46
45 EnterpriseEnrollmentHelper::EnterpriseEnrollmentHelper( 47 EnterpriseEnrollmentHelper::EnterpriseEnrollmentHelper(
46 EnrollmentStatusConsumer* status_consumer) 48 EnrollmentStatusConsumer* status_consumer)
47 : status_consumer_(status_consumer) { 49 : status_consumer_(status_consumer) {
48 DCHECK(status_consumer_); 50 DCHECK(status_consumer_);
49 } 51 }
50 52
51 } // namespace chromeos 53 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698