toast_surface.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2020 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 COMPONENTS_EXO_TOAST_SURFACE_H_
  5. #define COMPONENTS_EXO_TOAST_SURFACE_H_
  6. #include "components/exo/client_controlled_shell_surface.h"
  7. #include "components/exo/surface_delegate.h"
  8. #include "components/exo/surface_observer.h"
  9. namespace exo {
  10. class ToastSurfaceManager;
  11. // Handles toast surface role of a given surface.
  12. class ToastSurface : public ClientControlledShellSurface {
  13. public:
  14. ToastSurface(ToastSurfaceManager* manager,
  15. Surface* surface,
  16. bool default_scale_cancellation);
  17. ToastSurface(const ToastSurface&) = delete;
  18. ToastSurface& operator=(const ToastSurface&) = delete;
  19. ~ToastSurface() override;
  20. // Overridden from SurfaceDelegate:
  21. void OnSurfaceCommit() override;
  22. private:
  23. ToastSurfaceManager* const manager_;
  24. bool added_to_manager_ = false;
  25. };
  26. } // namespace exo
  27. #endif // COMPONENTS_EXO_TOAST_SURFACE_H_