Commit 21a8ee36 authored by Sara Kato's avatar Sara Kato Committed by Chromium LUCI CQ

views-posse: Add metadata to notification_view_md

Bug: 1159562
Test: build
Change-Id: I5cd5b56c5ef11899bdac3122ed1525a24bbf6fa5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2615725Reviewed-by: default avatarYoshiki Iguchi <yoshiki@chromium.org>
Reviewed-by: default avatarAllen Bauer <kylixrd@chromium.org>
Commit-Queue: Sara Kato <sarakato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#844496}
parent a6c875cd
......@@ -27,6 +27,7 @@
#include "ui/views/controls/image_view.h"
#include "ui/views/controls/scroll_view.h"
#include "ui/views/focus/focus_manager.h"
#include "ui/views/metadata/metadata_impl_macros.h"
#include "ui/views/style/platform_style.h"
#include "ui/views/widget/widget.h"
......@@ -75,8 +76,6 @@ bool ShouldShowAeroShadowBorder() {
} // namespace
// static
const char MessageView::kViewClassName[] = "MessageView";
MessageView::HighlightPathGenerator::HighlightPathGenerator() = default;
SkPath MessageView::HighlightPathGenerator::GetHighlightPath(
......@@ -281,10 +280,6 @@ void MessageView::OnBlur() {
SchedulePaint();
}
const char* MessageView::GetClassName() const {
return kViewClassName;
}
void MessageView::OnGestureEvent(ui::GestureEvent* event) {
switch (event->type()) {
case ui::ET_GESTURE_TAP_DOWN: {
......@@ -492,4 +487,7 @@ void MessageView::SetDrawBackgroundAsActive(bool active) {
SchedulePaint();
}
BEGIN_METADATA(MessageView, views::View)
END_METADATA
} // namespace message_center
......@@ -51,7 +51,7 @@ class MESSAGE_CENTER_EXPORT MessageView
public views::SlideOutControllerDelegate,
public views::FocusChangeListener {
public:
static const char kViewClassName[];
METADATA_HEADER(MessageView);
class Observer : public base::CheckedObserver {
public:
......@@ -83,6 +83,8 @@ class MESSAGE_CENTER_EXPORT MessageView
};
explicit MessageView(const Notification& notification);
MessageView(const MessageView&) = delete;
MessageView& operator=(const MessageView&) = delete;
~MessageView() override;
// Updates this view with the new data contained in the notification.
......@@ -129,7 +131,6 @@ class MESSAGE_CENTER_EXPORT MessageView
void OnGestureEvent(ui::GestureEvent* event) override;
void RemovedFromWidget() override;
void AddedToWidget() override;
const char* GetClassName() const final;
void OnThemeChanged() override;
// views::SlideOutControllerDelegate:
......@@ -238,7 +239,6 @@ class MESSAGE_CENTER_EXPORT MessageView
int top_radius_ = 0;
int bottom_radius_ = 0;
DISALLOW_COPY_AND_ASSIGN(MessageView);
};
} // namespace message_center
......
......@@ -188,10 +188,6 @@ std::unique_ptr<ui::Event> ConvertToBoundedLocatedEvent(const ui::Event& event,
CompactTitleMessageView::~CompactTitleMessageView() = default;
const char* CompactTitleMessageView::GetClassName() const {
return "CompactTitleMessageView";
}
CompactTitleMessageView::CompactTitleMessageView() {
title_ = AddChildView(std::make_unique<views::Label>(
base::string16(), views::style::CONTEXT_DIALOG_BODY_TEXT));
......@@ -240,6 +236,9 @@ void CompactTitleMessageView::set_message(const base::string16& message) {
message_->SetText(message);
}
BEGIN_METADATA(CompactTitleMessageView, views::View)
END_METADATA
// LargeImageView //////////////////////////////////////////////////////////////
LargeImageView::LargeImageView(const gfx::Size& max_size)
......@@ -276,10 +275,6 @@ void LargeImageView::OnPaint(gfx::Canvas* canvas) {
canvas->DrawImageInt(drawn_image, drawn_bounds.x(), drawn_bounds.y());
}
const char* LargeImageView::GetClassName() const {
return "LargeImageView";
}
void LargeImageView::OnThemeChanged() {
View::OnThemeChanged();
SetBackground(views::CreateSolidBackground(GetNativeTheme()->GetSystemColor(
......@@ -302,6 +297,9 @@ gfx::Size LargeImageView::GetResizedImageSize() {
return resized_size;
}
BEGIN_METADATA(LargeImageView, views::View)
END_METADATA
// NotificationMDTextButton ////////////////////////////////////////////////
NotificationMdTextButton::NotificationMdTextButton(
......@@ -461,6 +459,9 @@ void NotificationInputContainerMD::SetButtonImage() {
GetNativeTheme()->GetSystemColor(placeholder_icon_color_id)));
}
BEGIN_METADATA(NotificationInputContainerMD, views::InkDropHostView)
END_METADATA
// InlineSettingsRadioButton ///////////////////////////////////////////////////
class InlineSettingsRadioButton : public views::RadioButton {
......@@ -1490,4 +1491,7 @@ void NotificationViewMD::InkDropRippleAnimationEnded(
header_row_->SetSubpixelRenderingEnabled(true);
}
BEGIN_METADATA(NotificationViewMD, MessageView)
END_METADATA
} // namespace message_center
......@@ -43,6 +43,8 @@ class MESSAGE_CENTER_EXPORT NotificationMdTextButton
NotificationMdTextButton(PressedCallback callback,
const base::string16& label,
const base::Optional<base::string16>& placeholder);
NotificationMdTextButton(const NotificationMdTextButton&) = delete;
NotificationMdTextButton& operator=(const NotificationMdTextButton&) = delete;
~NotificationMdTextButton() override;
// views::MdTextButton:
......@@ -70,11 +72,13 @@ class MESSAGE_CENTER_EXPORT NotificationMdTextButton
// line. This view is used for NOTIFICATION_TYPE_PROGRESS.
class CompactTitleMessageView : public views::View {
public:
METADATA_HEADER(CompactTitleMessageView);
CompactTitleMessageView();
CompactTitleMessageView(const CompactTitleMessageView&) = delete;
CompactTitleMessageView& operator=(const CompactTitleMessageView&) = delete;
~CompactTitleMessageView() override;
const char* GetClassName() const override;
gfx::Size CalculatePreferredSize() const override;
void Layout() override;
......@@ -84,19 +88,20 @@ class CompactTitleMessageView : public views::View {
private:
views::Label* title_ = nullptr;
views::Label* message_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(CompactTitleMessageView);
};
class LargeImageView : public views::View {
public:
METADATA_HEADER(LargeImageView);
explicit LargeImageView(const gfx::Size& max_size);
LargeImageView(const LargeImageView&) = delete;
LargeImageView& operator=(const LargeImageView&) = delete;
~LargeImageView() override;
void SetImage(const gfx::ImageSkia& image);
void OnPaint(gfx::Canvas* canvas) override;
const char* GetClassName() const override;
void OnThemeChanged() override;
private:
......@@ -105,8 +110,6 @@ class LargeImageView : public views::View {
gfx::Size max_size_;
gfx::Size min_size_;
gfx::ImageSkia image_;
DISALLOW_COPY_AND_ASSIGN(LargeImageView);
};
class NotificationInputDelegate {
......@@ -119,7 +122,12 @@ class NotificationInputDelegate {
class NotificationInputContainerMD : public views::InkDropHostView,
public views::TextfieldController {
public:
METADATA_HEADER(NotificationInputContainerMD);
explicit NotificationInputContainerMD(NotificationInputDelegate* delegate);
NotificationInputContainerMD(const NotificationInputContainerMD&) = delete;
NotificationInputContainerMD& operator=(const NotificationInputContainerMD&) =
delete;
~NotificationInputContainerMD() override;
void AnimateBackground(const ui::Event& event);
......@@ -149,8 +157,6 @@ class NotificationInputContainerMD : public views::InkDropHostView,
views::Textfield* const textfield_;
views::ImageButton* const button_;
DISALLOW_COPY_AND_ASSIGN(NotificationInputContainerMD);
};
// View that displays all current types of notification (web, basic, image, and
......@@ -162,6 +168,8 @@ class MESSAGE_CENTER_EXPORT NotificationViewMD
public views::InkDropObserver,
public NotificationInputDelegate {
public:
METADATA_HEADER(NotificationViewMD);
// This defines an enumeration of IDs that can uniquely identify a view within
// the scope of NotificationViewMD.
enum ViewId {
......@@ -174,6 +182,9 @@ class MESSAGE_CENTER_EXPORT NotificationViewMD
};
explicit NotificationViewMD(const Notification& notification);
NotificationViewMD(const NotificationViewMD&) = delete;
NotificationViewMD& operator=(const NotificationViewMD&) = delete;
~NotificationViewMD() override;
void Activate();
......@@ -347,8 +358,6 @@ class MESSAGE_CENTER_EXPORT NotificationViewMD
base::TimeTicks last_mouse_pressed_timestamp_;
base::WeakPtrFactory<NotificationViewMD> weak_ptr_factory_{this};
DISALLOW_COPY_AND_ASSIGN(NotificationViewMD);
};
} // namespace message_center
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment