clipboard_history_main_button.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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_CLIPBOARD_VIEWS_CLIPBOARD_HISTORY_MAIN_BUTTON_H_
  5. #define ASH_CLIPBOARD_VIEWS_CLIPBOARD_HISTORY_MAIN_BUTTON_H_
  6. #include "ui/views/controls/button/button.h"
  7. namespace ash {
  8. class ClipboardHistoryItemView;
  9. // The view responding to mouse click or gesture tap events.
  10. class ClipboardHistoryMainButton : public views::Button {
  11. public:
  12. explicit ClipboardHistoryMainButton(ClipboardHistoryItemView* container);
  13. ClipboardHistoryMainButton(const ClipboardHistoryMainButton& rhs) = delete;
  14. ClipboardHistoryMainButton& operator=(const ClipboardHistoryMainButton& rhs) =
  15. delete;
  16. ~ClipboardHistoryMainButton() override;
  17. void OnHostPseudoFocusUpdated();
  18. private:
  19. void SetShouldHighlight(bool should_highlight);
  20. // views::Button:
  21. const char* GetClassName() const override;
  22. void OnClickCanceled(const ui::Event& event) override;
  23. void OnThemeChanged() override;
  24. void OnGestureEvent(ui::GestureEvent* event) override;
  25. void PaintButtonContents(gfx::Canvas* canvas) override;
  26. // The parent view.
  27. ClipboardHistoryItemView* const container_;
  28. // Indicates whether the view should be highlighted.
  29. bool should_highlight_ = false;
  30. };
  31. } // namespace ash
  32. #endif // ASH_CLIPBOARD_VIEWS_CLIPBOARD_HISTORY_MAIN_BUTTON_H_