#ifndef UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_VIEW_H_
#define UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_VIEW_H_
#include <optional>
#include "base/memory/raw_ptr.h"
#include "ui/base/metadata/metadata_header_macros.h"
#include "ui/color/color_variant.h"
#include "ui/message_center/message_center_export.h"
#include "ui/message_center/views/notification_view_base.h"
namespace views {
class LabelButton;
class RadioButton;
}
namespace message_center {
class MESSAGE_CENTER_EXPORT NotificationView : public NotificationViewBase {
METADATA_HEADER(NotificationView, NotificationViewBase)
public:
explicit NotificationView(const message_center::Notification& notification);
NotificationView(const NotificationView&) = delete;
NotificationView& operator=(const NotificationView&) = delete;
~NotificationView() override;
const std::optional<ui::ColorVariant>& GetActionButtonColorForTesting(
views::LabelButton* action_button);
private:
friend class NotificationViewTest;
class NotificationViewPathGenerator;
void CreateOrUpdateHeaderView(const Notification& notification) override;
void CreateOrUpdateTitleView(const Notification& notification) override;
void CreateOrUpdateSmallIconView(const Notification& notification) override;
void CreateOrUpdateInlineSettingsViews(
const Notification& notification) override;
void CreateOrUpdateSnoozeSettingsViews(
const Notification& notification) override;
std::unique_ptr<views::LabelButton> GenerateNotificationLabelButton(
views::Button::PressedCallback callback,
const std::u16string& label) override;
void UpdateViewForExpandedState(bool expanded) override;
gfx::Size GetIconViewSize() const override;
int GetLargeImageViewMaxWidth() const override;
void OnThemeChanged() override;
void UpdateCornerRadius(int top_radius, int bottom_radius) override;
void ToggleInlineSettings(const ui::Event& event) override;
void ToggleSnoozeSettings(const ui::Event& event) override;
bool IsExpandable() const override;
void AddLayerToRegion(ui::Layer* layer, views::LayerRegion region) override;
void RemoveLayerFromRegions(ui::Layer* layer) override;
void PreferredSizeChanged() override;
void Layout(PassKey) override;
void UpdateHeaderViewBackgroundColor();
SkColor GetNotificationHeaderViewBackgroundColor() const;
void UpdateActionButtonsRowBackground();
void AddBackgroundAnimation(const ui::Event& event);
void RemoveBackgroundAnimation();
std::vector<views::View*> GetChildrenForLayerAdjustment();
void HeaderRowPressed();
raw_ptr<views::Label, DanglingUntriaged> title_view_ = nullptr;
raw_ptr<views::RadioButton> block_all_button_ = nullptr;
raw_ptr<views::RadioButton> dont_block_button_ = nullptr;
raw_ptr<views::LabelButton> settings_done_button_ = nullptr;
const raw_ptr<views::InkDropContainerView> ink_drop_container_;
raw_ptr<NotificationViewPathGenerator> highlight_path_generator_ = nullptr;
base::WeakPtrFactory<NotificationView> weak_ptr_factory_{this};
};
}
#endif