in_app_to_home_nudge_controller.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2020 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_SHELF_IN_APP_TO_HOME_NUDGE_CONTROLLER_H_
  5. #define ASH_SHELF_IN_APP_TO_HOME_NUDGE_CONTROLLER_H_
  6. #include "ash/ash_export.h"
  7. namespace ash {
  8. class ShelfWidget;
  9. // Used by Chrome to notify shelf status changes and update in app to home
  10. // gesture contextual nudge UI.
  11. class ASH_EXPORT InAppToHomeNudgeController {
  12. public:
  13. explicit InAppToHomeNudgeController(ShelfWidget* shelf_widget);
  14. InAppToHomeNudgeController(const InAppToHomeNudgeController&) = delete;
  15. InAppToHomeNudgeController& operator=(const InAppToHomeNudgeController&) =
  16. delete;
  17. ~InAppToHomeNudgeController();
  18. // Sets whether the in app to home nudge can be shown for the current shelf
  19. // state. If the nudge is allowed, controller may show the nudge if required.
  20. // If the nudge is not allowed, the nudge will be hidden if currently visible.
  21. void SetNudgeAllowedForCurrentShelf(bool in_tablet_mode,
  22. bool in_app_shelf,
  23. bool shelf_controls_visible);
  24. private:
  25. // pointer to the shelf widget that owns the drag handle anchoring the nudge.
  26. ShelfWidget* const shelf_widget_;
  27. };
  28. } // namespace ash
  29. #endif // ASH_SHELF_IN_APP_TO_HOME_NUDGE_CONTROLLER_H_