window_preview_view_test_api.h 1.3 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_WM_WINDOW_PREVIEW_VIEW_TEST_API_H_
  5. #define ASH_WM_WINDOW_PREVIEW_VIEW_TEST_API_H_
  6. #include "ash/wm/window_mirror_view.h"
  7. #include "base/containers/flat_map.h"
  8. #include "ui/aura/window.h"
  9. #include "ui/gfx/geometry/rect_f.h"
  10. namespace views {
  11. class Widget;
  12. } // namespace views
  13. namespace ash {
  14. class WindowPreviewView;
  15. // Use the api in this class to test WindowPreviewView.
  16. class WindowPreviewViewTestApi {
  17. public:
  18. explicit WindowPreviewViewTestApi(WindowPreviewView* preview_view);
  19. WindowPreviewViewTestApi(const WindowPreviewViewTestApi&) = delete;
  20. WindowPreviewViewTestApi& operator=(const WindowPreviewViewTestApi&) = delete;
  21. ~WindowPreviewViewTestApi();
  22. gfx::RectF GetUnionRect() const;
  23. const base::flat_map<aura::Window*, WindowMirrorView*>& GetMirrorViews()
  24. const;
  25. // Gets the mirror view in |mirror_views_| associated with |widget|. Returns
  26. // null if |widget|'s window does not exist in |mirror_views_|.
  27. WindowMirrorView* GetMirrorViewForWidget(views::Widget* widget);
  28. private:
  29. WindowPreviewView* preview_view_;
  30. };
  31. } // namespace ash
  32. #endif // ASH_WM_WINDOW_PREVIEW_VIEW_TEST_API_H_