enterprise_domain_model.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // Copyright 2018 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef ASH_SYSTEM_MODEL_ENTERPRISE_DOMAIN_MODEL_H_
  5. #define ASH_SYSTEM_MODEL_ENTERPRISE_DOMAIN_MODEL_H_
  6. #include <memory>
  7. #include "ash/ash_export.h"
  8. #include "ash/public/cpp/login_types.h"
  9. #include "base/observer_list.h"
  10. namespace ash {
  11. class EnterpriseDomainObserver;
  12. // Model to store enterprise enrollment state.
  13. class ASH_EXPORT EnterpriseDomainModel {
  14. public:
  15. EnterpriseDomainModel();
  16. EnterpriseDomainModel(const EnterpriseDomainModel&) = delete;
  17. EnterpriseDomainModel& operator=(const EnterpriseDomainModel&) = delete;
  18. ~EnterpriseDomainModel();
  19. void AddObserver(EnterpriseDomainObserver* observer);
  20. void RemoveObserver(EnterpriseDomainObserver* observer);
  21. void SetDeviceEnterpriseInfo(
  22. const DeviceEnterpriseInfo& device_enterprise_info);
  23. // |account_domain_manager| should be either an empty string, a domain name
  24. // (foo.com) or an email address (user@foo.com). This string will be displayed
  25. // to the user without modification.
  26. void SetEnterpriseAccountDomainInfo(
  27. const std::string& account_domain_manager);
  28. const std::string& enterprise_domain_manager() const {
  29. return device_enterprise_info_.enterprise_domain_manager;
  30. }
  31. bool active_directory_managed() const {
  32. return device_enterprise_info_.active_directory_managed;
  33. }
  34. ManagementDeviceMode management_device_mode() const {
  35. return device_enterprise_info_.management_device_mode;
  36. }
  37. const std::string& account_domain_manager() const {
  38. return account_domain_manager_;
  39. }
  40. private:
  41. DeviceEnterpriseInfo device_enterprise_info_;
  42. std::string account_domain_manager_;
  43. base::ObserverList<EnterpriseDomainObserver>::Unchecked observers_;
  44. };
  45. } // namespace ash
  46. #endif // ASH_SYSTEM_MODEL_ENTERPRISE_DOMAIN_MODEL_H_