phone_hub_recent_app_button.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright 2021 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_PHONEHUB_PHONE_HUB_RECENT_APP_BUTTON_H_
  5. #define ASH_SYSTEM_PHONEHUB_PHONE_HUB_RECENT_APP_BUTTON_H_
  6. #include "ash/ash_export.h"
  7. #include "ash/components/phonehub/recent_apps_interaction_handler.h"
  8. #include "ui/base/metadata/metadata_header_macros.h"
  9. #include "ui/gfx/canvas.h"
  10. #include "ui/gfx/image/image.h"
  11. #include "ui/views/controls/button/image_button.h"
  12. namespace ash {
  13. // A recent app button containing a application |icon|. The |callback| provided
  14. // to build PhoneHubRecentAppButton implicitly contains the package name of the
  15. // same application.
  16. class ASH_EXPORT PhoneHubRecentAppButton : public views::ImageButton {
  17. public:
  18. METADATA_HEADER(PhoneHubRecentAppButton);
  19. PhoneHubRecentAppButton(const gfx::Image& icon,
  20. const std::u16string& visible_app_name,
  21. PressedCallback callback);
  22. ~PhoneHubRecentAppButton() override;
  23. PhoneHubRecentAppButton(PhoneHubRecentAppButton&) = delete;
  24. PhoneHubRecentAppButton operator=(PhoneHubRecentAppButton&) = delete;
  25. // views::View:
  26. gfx::Size CalculatePreferredSize() const override;
  27. // views::ImageButton:
  28. void PaintButtonContents(gfx::Canvas* canvas) override;
  29. };
  30. } // namespace ash
  31. #endif // ASH_SYSTEM_PHONEHUB_PHONE_HUB_RECENT_APP_BUTTON_H_