capture_mode_settings_test_api.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 ASH_CAPTURE_MODE_CAPTURE_MODE_SETTINGS_TEST_API_H_
  5. #define ASH_CAPTURE_MODE_CAPTURE_MODE_SETTINGS_TEST_API_H_
  6. #include "base/callback_forward.h"
  7. namespace views {
  8. class View;
  9. } // namespace views
  10. namespace ash {
  11. class CaptureModeSettingsView;
  12. class CaptureModeMenuGroup;
  13. // Test APIs to test the UI of the settings menu. Can only be created
  14. // while a capture mode session is active, and the settings menu is shown.
  15. class CaptureModeSettingsTestApi {
  16. public:
  17. CaptureModeSettingsTestApi();
  18. CaptureModeSettingsTestApi(const CaptureModeSettingsTestApi&) = delete;
  19. CaptureModeSettingsTestApi& operator=(const CaptureModeSettingsTestApi&) =
  20. delete;
  21. ~CaptureModeSettingsTestApi() = default;
  22. // Returns the content view of the settings widget.
  23. CaptureModeSettingsView* GetSettingsView();
  24. // Returns the audio settings menu group and the views for its options.
  25. CaptureModeMenuGroup* GetAudioInputMenuGroup();
  26. views::View* GetMicrophoneOption();
  27. views::View* GetAudioOffOption();
  28. // Returns the save-to settings menu group and the views for its options.
  29. CaptureModeMenuGroup* GetSaveToMenuGroup();
  30. views::View* GetDefaultDownloadsOption();
  31. views::View* GetCustomFolderOptionIfAny();
  32. // Returns the view for the "Select folder" menu item which when pressed would
  33. // open the folder selection dialog.
  34. views::View* GetSelectFolderMenuItem();
  35. CaptureModeMenuGroup* GetCameraMenuGroup();
  36. views::View* GetCameraOption(int option_id);
  37. // Sets a callback that will be triggered once the settings menu is refreshed.
  38. void SetOnSettingsMenuRefreshedCallback(base::OnceClosure callback);
  39. private:
  40. // Valid only while the settings menu is shown.
  41. CaptureModeSettingsView* const settings_view_;
  42. };
  43. } // namespace ash
  44. #endif // ASH_CAPTURE_MODE_CAPTURE_MODE_SETTINGS_TEST_API_H_