scroll_arrow_view.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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_SHELF_SCROLL_ARROW_VIEW_H_
  5. #define ASH_SHELF_SCROLL_ARROW_VIEW_H_
  6. #include "ash/ash_export.h"
  7. #include "ash/shelf/shelf_button.h"
  8. namespace ash {
  9. class Shelf;
  10. class ShelfButtonDelegate;
  11. class ASH_EXPORT ScrollArrowView : public ShelfButton {
  12. public:
  13. enum ArrowType { kLeft, kRight };
  14. ScrollArrowView(ArrowType arrow_type,
  15. bool is_horizontal_alignment,
  16. Shelf* shelf,
  17. ShelfButtonDelegate* button_listener);
  18. ScrollArrowView(const ScrollArrowView&) = delete;
  19. ScrollArrowView& operator=(const ScrollArrowView&) = delete;
  20. ~ScrollArrowView() override;
  21. void set_is_horizontal_alignment(bool is_horizontal_alignment) {
  22. is_horizontal_alignment_ = is_horizontal_alignment;
  23. }
  24. // views::Button:
  25. void NotifyClick(const ui::Event& event) override;
  26. // views::View:
  27. void PaintButtonContents(gfx::Canvas* canvas) override;
  28. const char* GetClassName() const override;
  29. void OnThemeChanged() override;
  30. private:
  31. ArrowType arrow_type_ = kLeft;
  32. bool is_horizontal_alignment_ = true;
  33. };
  34. } // namespace ash
  35. #endif // ASH_SHELF_SCROLL_ARROW_VIEW_H_