OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/policy/stub_enterprise_install_attributes.h" | 5 #include "chrome/browser/chromeos/settings/stub_install_attributes.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 9 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
10 #include "components/policy/core/common/cloud/cloud_policy_constants.h" | 10 #include "components/policy/core/common/cloud/cloud_policy_constants.h" |
11 | 11 |
12 namespace policy { | 12 namespace chromeos { |
13 | 13 |
14 StubEnterpriseInstallAttributes::StubEnterpriseInstallAttributes() | 14 StubInstallAttributes::StubInstallAttributes() : InstallAttributes(nullptr) { |
15 : EnterpriseInstallAttributes(NULL) { | |
16 device_locked_ = true; | 15 device_locked_ = true; |
17 } | 16 } |
18 | 17 |
19 void StubEnterpriseInstallAttributes::SetDomain(const std::string& domain) { | 18 void StubInstallAttributes::SetDomain(const std::string& domain) { |
20 registration_domain_ = domain; | 19 registration_domain_ = domain; |
21 } | 20 } |
22 | 21 |
23 void StubEnterpriseInstallAttributes::SetRegistrationUser( | 22 void StubInstallAttributes::SetRegistrationUser(const std::string& user) { |
24 const std::string& user) { | |
25 registration_user_ = user; | 23 registration_user_ = user; |
26 } | 24 } |
27 | 25 |
28 void StubEnterpriseInstallAttributes::SetDeviceId(const std::string& id) { | 26 void StubInstallAttributes::SetDeviceId(const std::string& id) { |
29 registration_device_id_ = id; | 27 registration_device_id_ = id; |
30 } | 28 } |
31 | 29 |
32 void StubEnterpriseInstallAttributes::SetMode(DeviceMode mode) { | 30 void StubInstallAttributes::SetMode(policy::DeviceMode mode) { |
33 registration_mode_ = mode; | 31 registration_mode_ = mode; |
34 } | 32 } |
35 | 33 |
36 ScopedStubEnterpriseInstallAttributes::ScopedStubEnterpriseInstallAttributes( | 34 ScopedStubInstallAttributes::ScopedStubInstallAttributes( |
37 const std::string& domain, | 35 const std::string& domain, |
38 const std::string& registration_user, | 36 const std::string& registration_user, |
39 const std::string& device_id, | 37 const std::string& device_id, |
40 DeviceMode mode) { | 38 policy::DeviceMode mode) { |
41 StubEnterpriseInstallAttributes* attributes = | 39 StubInstallAttributes* attributes = new StubInstallAttributes(); |
42 new StubEnterpriseInstallAttributes(); | |
43 attributes->SetDomain(domain); | 40 attributes->SetDomain(domain); |
44 attributes->SetRegistrationUser(registration_user); | 41 attributes->SetRegistrationUser(registration_user); |
45 attributes->SetDeviceId(device_id); | 42 attributes->SetDeviceId(device_id); |
46 attributes->SetMode(mode); | 43 attributes->SetMode(mode); |
47 BrowserPolicyConnectorChromeOS::SetInstallAttributesForTesting(attributes); | 44 policy::BrowserPolicyConnectorChromeOS::SetInstallAttributesForTesting( |
| 45 attributes); |
48 } | 46 } |
49 | 47 |
50 ScopedStubEnterpriseInstallAttributes:: | 48 ScopedStubInstallAttributes::~ScopedStubInstallAttributes() { |
51 ~ScopedStubEnterpriseInstallAttributes() { | 49 policy::BrowserPolicyConnectorChromeOS::RemoveInstallAttributesForTesting(); |
52 BrowserPolicyConnectorChromeOS::RemoveInstallAttributesForTesting(); | |
53 } | 50 } |
54 | 51 |
55 } // namespace policy | 52 } // namespace chromeos |
OLD | NEW |