window_frame_provider.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2021 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 UI_LINUX_WINDOW_FRAME_PROVIDER_H_
  5. #define UI_LINUX_WINDOW_FRAME_PROVIDER_H_
  6. namespace gfx {
  7. class Canvas;
  8. class Insets;
  9. class Rect;
  10. } // namespace gfx
  11. namespace ui {
  12. class WindowFrameProvider {
  13. public:
  14. virtual ~WindowFrameProvider() = default;
  15. // Returns the radius of the top-left and top-right corners in DIPs. Used
  16. // only as a hint to the compositor so it knows to redraw the part of the
  17. // window behind the corners.
  18. virtual int GetTopCornerRadiusDip() = 0;
  19. // Returns the shadow and border drawn around the window in DIPs.
  20. virtual gfx::Insets GetFrameThicknessDip() = 0;
  21. // Draws a native window border and shadow. |rect| is the bounds of the
  22. // window. The decoration will be drawn outside of that region.
  23. virtual void PaintWindowFrame(gfx::Canvas* canvas,
  24. const gfx::Rect& rect,
  25. int top_area_height,
  26. bool focused) = 0;
  27. };
  28. } // namespace ui
  29. #endif // UI_LINUX_WINDOW_FRAME_PROVIDER_H_