enterprise_domain_model.cc 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. #include "ash/system/model/enterprise_domain_model.h"
  5. #include "ash/public/cpp/login_types.h"
  6. #include "ash/system/enterprise/enterprise_domain_observer.h"
  7. namespace ash {
  8. EnterpriseDomainModel::EnterpriseDomainModel() {}
  9. EnterpriseDomainModel::~EnterpriseDomainModel() = default;
  10. void EnterpriseDomainModel::AddObserver(EnterpriseDomainObserver* observer) {
  11. observers_.AddObserver(observer);
  12. }
  13. void EnterpriseDomainModel::RemoveObserver(EnterpriseDomainObserver* observer) {
  14. observers_.RemoveObserver(observer);
  15. }
  16. void EnterpriseDomainModel::SetDeviceEnterpriseInfo(
  17. const DeviceEnterpriseInfo& device_enterprise_info) {
  18. device_enterprise_info_ = device_enterprise_info;
  19. for (auto& observer : observers_)
  20. observer.OnDeviceEnterpriseInfoChanged();
  21. }
  22. void EnterpriseDomainModel::SetEnterpriseAccountDomainInfo(
  23. const std::string& account_domain_manager) {
  24. account_domain_manager_ = account_domain_manager;
  25. for (auto& observer : observers_)
  26. observer.OnEnterpriseAccountDomainChanged();
  27. }
  28. } // namespace ash