chromium/ui/message_center/views/notification_view.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ui/message_center/views/notification_view.h"

#include <memory>

#include "build/build_config.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_header_macros.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/color/color_id.h"
#include "ui/color/color_provider.h"
#include "ui/compositor/layer.h"
#include "ui/gfx/color_utils.h"
#include "ui/gfx/text_elider.h"
#include "ui/message_center/message_center.h"
#include "ui/message_center/views/notification_background_painter.h"
#include "ui/message_center/views/notification_control_button_factory.h"
#include "ui/message_center/views/notification_control_buttons_view.h"
#include "ui/message_center/views/notification_header_view.h"
#include "ui/message_center/views/notification_view_base.h"
#include "ui/message_center/views/notification_view_util.h"
#include "ui/strings/grit/ui_strings.h"
#include "ui/views/animation/flood_fill_ink_drop_ripple.h"
#include "ui/views/animation/ink_drop.h"
#include "ui/views/animation/ink_drop_highlight.h"
#include "ui/views/animation/ink_drop_host.h"
#include "ui/views/animation/ink_drop_impl.h"
#include "ui/views/background.h"
#include "ui/views/controls/button/md_text_button.h"
#include "ui/views/controls/button/radio_button.h"
#include "ui/views/controls/highlight_path_generator.h"
#include "ui/views/layout/box_layout.h"

namespace message_center {

namespace {

// TODO(crbug.com/40787532): Move the padding and spacing definition from
// NotificationViewBase to this class.

constexpr auto kContentRowPadding =;
// TODO(tetsui): Move |kIconViewSize| to public/cpp/message_center_constants.h
// and merge with contradicting |kNotificationIconSize|.
constexpr gfx::Size kIconViewSize(36, 36);
constexpr auto kLeftContentPadding =;
constexpr auto kLeftContentPaddingWithIcon =;

// Minimum size of a button in the actions row.
constexpr gfx::Size kActionButtonMinSize(0, 32);

constexpr int kMessageLabelWidthWithIcon =;

constexpr int kMessageLabelWidth =;

constexpr auto kLargeImageContainerPadding =;

// Max number of lines for title_view_.
constexpr int kMaxLinesForTitleView =;

constexpr int kTitleCharacterLimit =;

// "Roboto-Regular, 12sp" is specified in the mock.
constexpr int kHeaderTextFontSize =;

// Default paddings of the views of texts. Adjusted on Windows.
// Top: 9px = 11px (from the mock) - 2px (outer padding).
// Bottom: 6px from the mock.
constexpr auto kTextViewPaddingDefault =;

constexpr auto kSettingsRowPadding =;
constexpr auto kSettingsRadioButtonPadding =;
constexpr gfx::Insets kSettingsButtonRowPadding(8);

gfx::FontList GetHeaderTextFontList() {}

gfx::Insets CalculateTopPadding(int font_list_height) {}

// NotificationTextButton //////////////////////////////////////////////////////

// TODO(crbug/1241983): Add metadata and builder support to this view.

// NotificationTextButton extends MdTextButton to allow for placeholder text
// as well as capitalizing the given label string. Used by chrome notifications.
// Ash notifications create their own.
class NotificationTextButton : public views::MdTextButton {};

BEGIN_METADATA()

// InlineSettingsRadioButton ///////////////////////////////////////////////////

class InlineSettingsRadioButton : public views::RadioButton {};

BEGIN_METADATA()

// NotificationInkDropImpl /////////////////////////////////////////////////////

class NotificationInkDropImpl : public views::InkDropImpl {};

}  // namespace

class NotificationView::NotificationViewPathGenerator
    : public views::HighlightPathGenerator {};

NotificationView::NotificationView(
    const message_center::Notification& notification)
    :{}

NotificationView::~NotificationView() {}

SkColor NotificationView::GetActionButtonColorForTesting(
    views::LabelButton* action_button) {}

void NotificationView::CreateOrUpdateHeaderView(
    const Notification& notification) {}

void NotificationView::CreateOrUpdateTitleView(
    const Notification& notification) {}

void NotificationView::CreateOrUpdateSmallIconView(
    const Notification& notification) {}

void NotificationView::CreateOrUpdateInlineSettingsViews(
    const Notification& notification) {}

void NotificationView::CreateOrUpdateSnoozeSettingsViews(
    const Notification& notification) {}

std::unique_ptr<views::LabelButton>
NotificationView::GenerateNotificationLabelButton(
    views::Button::PressedCallback callback,
    const std::u16string& label) {}

void NotificationView::UpdateViewForExpandedState(bool expanded) {}

gfx::Size NotificationView::GetIconViewSize() const {}

int NotificationView::GetLargeImageViewMaxWidth() const {}

void NotificationView::OnThemeChanged() {}

void NotificationView::UpdateCornerRadius(int top_radius, int bottom_radius) {}

void NotificationView::ToggleInlineSettings(const ui::Event& event) {}

void NotificationView::ToggleSnoozeSettings(const ui::Event& event) {}

bool NotificationView::IsExpandable() const {}

void NotificationView::AddLayerToRegion(ui::Layer* layer,
                                        views::LayerRegion region) {}

void NotificationView::RemoveLayerFromRegions(ui::Layer* layer) {}

void NotificationView::Layout(PassKey) {}

void NotificationView::PreferredSizeChanged() {}

void NotificationView::UpdateHeaderViewBackgroundColor() {}

SkColor NotificationView::GetNotificationHeaderViewBackgroundColor() const {}

void NotificationView::UpdateActionButtonsRowBackground() {}

void NotificationView::AddBackgroundAnimation(const ui::Event& event) {}

void NotificationView::RemoveBackgroundAnimation() {}

std::vector<views::View*> NotificationView::GetChildrenForLayerAdjustment() {}

void NotificationView::HeaderRowPressed() {}

BEGIN_METADATA()

}  // namespace message_center