clipboard_history_delete_button.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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_DELETE_BUTTON_H_
  5. #define ASH_CLIPBOARD_VIEWS_CLIPBOARD_HISTORY_DELETE_BUTTON_H_
  6. #include "ash/style/close_button.h"
  7. #include "ui/base/metadata/metadata_header_macros.h"
  8. namespace views {
  9. class InkDropContainerView;
  10. } // namespace views
  11. namespace ash {
  12. class ClipboardHistoryItemView;
  13. // The button to delete the menu item and its corresponding clipboard data.
  14. class ClipboardHistoryDeleteButton : public CloseButton {
  15. public:
  16. METADATA_HEADER(ClipboardHistoryDeleteButton);
  17. explicit ClipboardHistoryDeleteButton(ClipboardHistoryItemView* listener);
  18. ClipboardHistoryDeleteButton(const ClipboardHistoryDeleteButton& rhs) =
  19. delete;
  20. ClipboardHistoryDeleteButton& operator=(
  21. const ClipboardHistoryDeleteButton& rhs) = delete;
  22. ~ClipboardHistoryDeleteButton() override;
  23. private:
  24. // views::ImageButton:
  25. void AddLayerBeneathView(ui::Layer* layer) override;
  26. void OnClickCanceled(const ui::Event& event) override;
  27. void RemoveLayerBeneathView(ui::Layer* layer) override;
  28. // Used to accommodate the ink drop layer. It ensures that the ink drop is
  29. // above the view background.
  30. views::InkDropContainerView* ink_drop_container_ = nullptr;
  31. // The listener of button events.
  32. ClipboardHistoryItemView* const listener_;
  33. };
  34. } // namespace ash
  35. #endif // ASH_CLIPBOARD_VIEWS_CLIPBOARD_HISTORY_DELETE_BUTTON_H_