managed_device_tray_item_view.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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_UNIFIED_MANAGED_DEVICE_TRAY_ITEM_VIEW_H_
  5. #define ASH_SYSTEM_UNIFIED_MANAGED_DEVICE_TRAY_ITEM_VIEW_H_
  6. #include "ash/public/cpp/session/session_observer.h"
  7. #include "ash/system/enterprise/enterprise_domain_observer.h"
  8. #include "ash/system/tray/tray_item_view.h"
  9. namespace ash {
  10. // A view to show an icon in the status tray when the device is managed by
  11. // an organization admin. Observes login status in order to show/hide the
  12. // icon reflecting the latest status.
  13. class ManagedDeviceTrayItemView : public TrayItemView,
  14. public SessionObserver,
  15. public EnterpriseDomainObserver {
  16. public:
  17. explicit ManagedDeviceTrayItemView(Shelf* shelf);
  18. ManagedDeviceTrayItemView(const ManagedDeviceTrayItemView&) = delete;
  19. ManagedDeviceTrayItemView& operator=(const ManagedDeviceTrayItemView&) =
  20. delete;
  21. ~ManagedDeviceTrayItemView() override;
  22. // SessionObserver:
  23. void OnLoginStatusChanged(LoginStatus status) override;
  24. // EnterpriseDomainObserver:
  25. void OnDeviceEnterpriseInfoChanged() override;
  26. void OnEnterpriseAccountDomainChanged() override;
  27. // views::TrayItemView:
  28. const char* GetClassName() const override;
  29. void HandleLocaleChange() override;
  30. private:
  31. void Update();
  32. };
  33. } // namespace ash
  34. #endif // ASH_SYSTEM_UNIFIED_MANAGED_DEVICE_TRAY_ITEM_VIEW_H_