display_shutdown_observer.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2016 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_DISPLAY_DISPLAY_SHUTDOWN_OBSERVER_H_
  5. #define ASH_DISPLAY_DISPLAY_SHUTDOWN_OBSERVER_H_
  6. #include "ash/public/cpp/session/session_observer.h"
  7. namespace display {
  8. class DisplayConfigurator;
  9. }
  10. namespace ash {
  11. // Adds self as SessionObserver and listens for OnChromeTerminating() on
  12. // behalf of |display_configurator_|.
  13. class DisplayShutdownObserver : public SessionObserver {
  14. public:
  15. explicit DisplayShutdownObserver(
  16. display::DisplayConfigurator* display_configurator);
  17. DisplayShutdownObserver(const DisplayShutdownObserver&) = delete;
  18. DisplayShutdownObserver& operator=(const DisplayShutdownObserver&) = delete;
  19. ~DisplayShutdownObserver() override;
  20. private:
  21. // SessionObserver:
  22. void OnChromeTerminating() override;
  23. display::DisplayConfigurator* const display_configurator_;
  24. ScopedSessionObserver scoped_session_observer_;
  25. };
  26. } // namespace ash
  27. #endif // ASH_DISPLAY_DISPLAY_SHUTDOWN_OBSERVER_H_