split_view_test_api.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Copyright 2019 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_PUBLIC_CPP_SPLIT_VIEW_TEST_API_H_
  5. #define ASH_PUBLIC_CPP_SPLIT_VIEW_TEST_API_H_
  6. #include "ash/ash_export.h"
  7. namespace aura {
  8. class Window;
  9. } // namespace aura
  10. namespace ash {
  11. // Provides access to the limited functions of SplitViewController for testing.
  12. class ASH_EXPORT SplitViewTestApi {
  13. public:
  14. // See SplitViewController::SnapPosition.
  15. enum class SnapPosition { NONE, LEFT, RIGHT };
  16. SplitViewTestApi();
  17. SplitViewTestApi(const SplitViewTestApi&) = delete;
  18. SplitViewTestApi& operator=(const SplitViewTestApi&) = delete;
  19. ~SplitViewTestApi();
  20. // Snaps the window to left/right in the split view.
  21. void SnapWindow(aura::Window* window, SnapPosition snap_position);
  22. // Swaps left and right windows in the split view.
  23. void SwapWindows();
  24. // Gets the left and right window in the split view. May be null if there
  25. // isn't one.
  26. aura::Window* GetLeftWindow() const;
  27. aura::Window* GetRightWindow() const;
  28. };
  29. } // namespace ash
  30. #endif // ASH_PUBLIC_CPP_SPLIT_VIEW_TEST_API_H_