capture_mode_session_test_api.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // Copyright 2022 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_CAPTURE_MODE_CAPTURE_MODE_SESSION_TEST_API_H_
  5. #define ASH_CAPTURE_MODE_CAPTURE_MODE_SESSION_TEST_API_H_
  6. #include "capture_mode_session_focus_cycler.h"
  7. namespace ash {
  8. class CaptureModeSession;
  9. class CaptureModeBarView;
  10. class CaptureModeSettingsView;
  11. class UserNudgeController;
  12. class MagnifierGlass;
  13. // Wrapper for CaptureModeSession that exposes internal state to test functions.
  14. class CaptureModeSessionTestApi {
  15. public:
  16. explicit CaptureModeSessionTestApi(CaptureModeSession* session);
  17. CaptureModeSessionTestApi(CaptureModeSessionTestApi&) = delete;
  18. CaptureModeSessionTestApi& operator=(CaptureModeSessionTestApi&) = delete;
  19. ~CaptureModeSessionTestApi() = default;
  20. CaptureModeBarView* GetCaptureModeBarView();
  21. CaptureModeSettingsView* GetCaptureModeSettingsView();
  22. views::Widget* GetCaptureModeSettingsWidget();
  23. views::Widget* GetCaptureLabelWidget();
  24. views::Widget* GetDimensionsLabelWidget();
  25. UserNudgeController* GetUserNudgeController();
  26. MagnifierGlass& GetMagnifierGlass();
  27. bool IsUsingCustomCursor(CaptureModeType type);
  28. CaptureModeSessionFocusCycler::FocusGroup GetCurrentFocusGroup();
  29. size_t GetCurrentFocusIndex();
  30. CaptureModeSessionFocusCycler::HighlightableWindow* GetHighlightableWindow(
  31. aura::Window* window);
  32. CaptureModeSessionFocusCycler::HighlightableView* GetCurrentFocusedView();
  33. // Returns false if `current_focus_group_` equals to `kNone` which means
  34. // there's no focus on any focus group for now. Otherwise, returns true;
  35. bool HasFocus();
  36. bool IsFolderSelectionDialogShown();
  37. // Returns true if all UIs (cursors, widgets, and paintings on the layer) of
  38. // the capture mode session is visible.
  39. bool IsAllUisVisible();
  40. private:
  41. CaptureModeSession* const session_;
  42. };
  43. } // namespace ash
  44. #endif // ASH_CAPTURE_MODE_CAPTURE_MODE_SESSION_TEST_API_H_