palette_tray_test_api.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // Copyright 2017 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_SYSTEM_PALETTE_PALETTE_TRAY_TEST_API_H_
  5. #define ASH_SYSTEM_PALETTE_PALETTE_TRAY_TEST_API_H_
  6. #include "ash/system/palette/palette_tray.h"
  7. namespace ash {
  8. class PaletteToolManager;
  9. class PaletteWelcomeBubble;
  10. class TrayBubbleWrapper;
  11. // Use the api in this class to test PaletteTray.
  12. class PaletteTrayTestApi {
  13. public:
  14. explicit PaletteTrayTestApi(PaletteTray* palette_tray);
  15. PaletteTrayTestApi(const PaletteTrayTestApi&) = delete;
  16. PaletteTrayTestApi& operator=(const PaletteTrayTestApi&) = delete;
  17. ~PaletteTrayTestApi();
  18. PaletteToolManager* palette_tool_manager() {
  19. return palette_tray_->palette_tool_manager_.get();
  20. }
  21. PaletteWelcomeBubble* welcome_bubble() {
  22. return palette_tray_->welcome_bubble_.get();
  23. }
  24. TrayBubbleWrapper* tray_bubble_wrapper() {
  25. return palette_tray_->bubble_.get();
  26. }
  27. void OnStylusStateChanged(ui::StylusState state) {
  28. palette_tray_->OnStylusStateChanged(state);
  29. }
  30. // Have the tray act as though it is on a display with a stylus
  31. void SetDisplayHasStylus() { palette_tray_->SetDisplayHasStylusForTesting(); }
  32. private:
  33. PaletteTray* palette_tray_ = nullptr;
  34. };
  35. } // namespace ash
  36. #endif // ASH_SYSTEM_PALETTE_PALETTE_TRAY_TEST_API_H_