1b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)// Copyright (c) 2013 The Chromium Authors. All rights reserved.
2b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
3b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)// found in the LICENSE file.
4b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)
5b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)#ifndef CHROME_BROWSER_CHROMEOS_POLICY_STUB_ENTERPRISE_INSTALL_ATTRIBUTES_H_
6b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)#define CHROME_BROWSER_CHROMEOS_POLICY_STUB_ENTERPRISE_INSTALL_ATTRIBUTES_H_
7b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)
8b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)#include <string>
9b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)
10b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)#include "base/basictypes.h"
11b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)#include "chrome/browser/chromeos/policy/enterprise_install_attributes.h"
12a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)#include "components/policy/core/common/cloud/cloud_policy_constants.h"
13b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)
14b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)namespace policy {
15b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)
16b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)// This class allows tests to override specific values for easier testing.
17b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)// To make IsEnterpriseDevice() return true, set a non-empty registration
18b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)// user.
19b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)class StubEnterpriseInstallAttributes : public EnterpriseInstallAttributes {
20b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles) public:
21b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)  StubEnterpriseInstallAttributes();
22b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)
23b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)  void SetDomain(const std::string& domain);
24b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)  void SetRegistrationUser(const std::string& user);
25b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)  void SetDeviceId(const std::string& id);
26b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)  void SetMode(DeviceMode mode);
27b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)
28b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles) private:
29b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(StubEnterpriseInstallAttributes);
30b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)};
31b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)
325c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu// Helper class to set enterprise install attributes in the scope of a test.
335c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liuclass ScopedStubEnterpriseInstallAttributes {
345c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu public:
355c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu  ScopedStubEnterpriseInstallAttributes(const std::string& domain,
365c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu                                        const std::string& registration_user,
375c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu                                        const std::string& device_id,
385c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu                                        DeviceMode mode);
395c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu  ~ScopedStubEnterpriseInstallAttributes();
405c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu};
415c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu
42b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)}  // namespace policy
43b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)
44b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)#endif  // CHROME_BROWSER_CHROMEOS_POLICY_STUB_ENTERPRISE_INSTALL_ATTRIBUTES_H_
45