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 @@ ...@@ -27,6 +27,7 @@
#include "ui/views/controls/image_view.h" #include "ui/views/controls/image_view.h"
#include "ui/views/controls/scroll_view.h" #include "ui/views/controls/scroll_view.h"
#include "ui/views/focus/focus_manager.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/style/platform_style.h"
#include "ui/views/widget/widget.h" #include "ui/views/widget/widget.h"
...@@ -75,8 +76,6 @@ bool ShouldShowAeroShadowBorder() { ...@@ -75,8 +76,6 @@ bool ShouldShowAeroShadowBorder() {
} // namespace } // namespace
// static // static
const char MessageView::kViewClassName[] = "MessageView";
MessageView::HighlightPathGenerator::HighlightPathGenerator() = default; MessageView::HighlightPathGenerator::HighlightPathGenerator() = default;
SkPath MessageView::HighlightPathGenerator::GetHighlightPath( SkPath MessageView::HighlightPathGenerator::GetHighlightPath(
...@@ -281,10 +280,6 @@ void MessageView::OnBlur() { ...@@ -281,10 +280,6 @@ void MessageView::OnBlur() {
SchedulePaint(); SchedulePaint();
} }
const char* MessageView::GetClassName() const {
return kViewClassName;
}
void MessageView::OnGestureEvent(ui::GestureEvent* event) { void MessageView::OnGestureEvent(ui::GestureEvent* event) {
switch (event->type()) { switch (event->type()) {
case ui::ET_GESTURE_TAP_DOWN: { case ui::ET_GESTURE_TAP_DOWN: {
...@@ -492,4 +487,7 @@ void MessageView::SetDrawBackgroundAsActive(bool active) { ...@@ -492,4 +487,7 @@ void MessageView::SetDrawBackgroundAsActive(bool active) {
SchedulePaint(); SchedulePaint();
} }
BEGIN_METADATA(MessageView, views::View)
END_METADATA
} // namespace message_center } // namespace message_center
...@@ -51,7 +51,7 @@ class MESSAGE_CENTER_EXPORT MessageView ...@@ -51,7 +51,7 @@ class MESSAGE_CENTER_EXPORT MessageView
public views::SlideOutControllerDelegate, public views::SlideOutControllerDelegate,
public views::FocusChangeListener { public views::FocusChangeListener {
public: public:
static const char kViewClassName[]; METADATA_HEADER(MessageView);
class Observer : public base::CheckedObserver { class Observer : public base::CheckedObserver {
public: public:
...@@ -83,6 +83,8 @@ class MESSAGE_CENTER_EXPORT MessageView ...@@ -83,6 +83,8 @@ class MESSAGE_CENTER_EXPORT MessageView
}; };
explicit MessageView(const Notification& notification); explicit MessageView(const Notification& notification);
MessageView(const MessageView&) = delete;
MessageView& operator=(const MessageView&) = delete;
~MessageView() override; ~MessageView() override;
// Updates this view with the new data contained in the notification. // Updates this view with the new data contained in the notification.
...@@ -129,7 +131,6 @@ class MESSAGE_CENTER_EXPORT MessageView ...@@ -129,7 +131,6 @@ class MESSAGE_CENTER_EXPORT MessageView
void OnGestureEvent(ui::GestureEvent* event) override; void OnGestureEvent(ui::GestureEvent* event) override;
void RemovedFromWidget() override; void RemovedFromWidget() override;
void AddedToWidget() override; void AddedToWidget() override;
const char* GetClassName() const final;
void OnThemeChanged() override; void OnThemeChanged() override;
// views::SlideOutControllerDelegate: // views::SlideOutControllerDelegate:
...@@ -238,7 +239,6 @@ class MESSAGE_CENTER_EXPORT MessageView ...@@ -238,7 +239,6 @@ class MESSAGE_CENTER_EXPORT MessageView
int top_radius_ = 0; int top_radius_ = 0;
int bottom_radius_ = 0; int bottom_radius_ = 0;
DISALLOW_COPY_AND_ASSIGN(MessageView);
}; };
} // namespace message_center } // namespace message_center
......
...@@ -188,10 +188,6 @@ std::unique_ptr<ui::Event> ConvertToBoundedLocatedEvent(const ui::Event& event, ...@@ -188,10 +188,6 @@ std::unique_ptr<ui::Event> ConvertToBoundedLocatedEvent(const ui::Event& event,
CompactTitleMessageView::~CompactTitleMessageView() = default; CompactTitleMessageView::~CompactTitleMessageView() = default;
const char* CompactTitleMessageView::GetClassName() const {
return "CompactTitleMessageView";
}
CompactTitleMessageView::CompactTitleMessageView() { CompactTitleMessageView::CompactTitleMessageView() {
title_ = AddChildView(std::make_unique<views::Label>( title_ = AddChildView(std::make_unique<views::Label>(
base::string16(), views::style::CONTEXT_DIALOG_BODY_TEXT)); base::string16(), views::style::CONTEXT_DIALOG_BODY_TEXT));
...@@ -240,6 +236,9 @@ void CompactTitleMessageView::set_message(const base::string16& message) { ...@@ -240,6 +236,9 @@ void CompactTitleMessageView::set_message(const base::string16& message) {
message_->SetText(message); message_->SetText(message);
} }
BEGIN_METADATA(CompactTitleMessageView, views::View)
END_METADATA
// LargeImageView ////////////////////////////////////////////////////////////// // LargeImageView //////////////////////////////////////////////////////////////
LargeImageView::LargeImageView(const gfx::Size& max_size) LargeImageView::LargeImageView(const gfx::Size& max_size)
...@@ -276,10 +275,6 @@ void LargeImageView::OnPaint(gfx::Canvas* canvas) { ...@@ -276,10 +275,6 @@ void LargeImageView::OnPaint(gfx::Canvas* canvas) {
canvas->DrawImageInt(drawn_image, drawn_bounds.x(), drawn_bounds.y()); canvas->DrawImageInt(drawn_image, drawn_bounds.x(), drawn_bounds.y());
} }
const char* LargeImageView::GetClassName() const {
return "LargeImageView";
}
void LargeImageView::OnThemeChanged() { void LargeImageView::OnThemeChanged() {
View::OnThemeChanged(); View::OnThemeChanged();
SetBackground(views::CreateSolidBackground(GetNativeTheme()->GetSystemColor( SetBackground(views::CreateSolidBackground(GetNativeTheme()->GetSystemColor(
...@@ -302,6 +297,9 @@ gfx::Size LargeImageView::GetResizedImageSize() { ...@@ -302,6 +297,9 @@ gfx::Size LargeImageView::GetResizedImageSize() {
return resized_size; return resized_size;
} }
BEGIN_METADATA(LargeImageView, views::View)
END_METADATA
// NotificationMDTextButton //////////////////////////////////////////////// // NotificationMDTextButton ////////////////////////////////////////////////
NotificationMdTextButton::NotificationMdTextButton( NotificationMdTextButton::NotificationMdTextButton(
...@@ -461,6 +459,9 @@ void NotificationInputContainerMD::SetButtonImage() { ...@@ -461,6 +459,9 @@ void NotificationInputContainerMD::SetButtonImage() {
GetNativeTheme()->GetSystemColor(placeholder_icon_color_id))); GetNativeTheme()->GetSystemColor(placeholder_icon_color_id)));
} }
BEGIN_METADATA(NotificationInputContainerMD, views::InkDropHostView)
END_METADATA
// InlineSettingsRadioButton /////////////////////////////////////////////////// // InlineSettingsRadioButton ///////////////////////////////////////////////////
class InlineSettingsRadioButton : public views::RadioButton { class InlineSettingsRadioButton : public views::RadioButton {
...@@ -1490,4 +1491,7 @@ void NotificationViewMD::InkDropRippleAnimationEnded( ...@@ -1490,4 +1491,7 @@ void NotificationViewMD::InkDropRippleAnimationEnded(
header_row_->SetSubpixelRenderingEnabled(true); header_row_->SetSubpixelRenderingEnabled(true);
} }
BEGIN_METADATA(NotificationViewMD, MessageView)
END_METADATA
} // namespace message_center } // namespace message_center
...@@ -43,6 +43,8 @@ class MESSAGE_CENTER_EXPORT NotificationMdTextButton ...@@ -43,6 +43,8 @@ class MESSAGE_CENTER_EXPORT NotificationMdTextButton
NotificationMdTextButton(PressedCallback callback, NotificationMdTextButton(PressedCallback callback,
const base::string16& label, const base::string16& label,
const base::Optional<base::string16>& placeholder); const base::Optional<base::string16>& placeholder);
NotificationMdTextButton(const NotificationMdTextButton&) = delete;
NotificationMdTextButton& operator=(const NotificationMdTextButton&) = delete;
~NotificationMdTextButton() override; ~NotificationMdTextButton() override;
// views::MdTextButton: // views::MdTextButton:
...@@ -70,11 +72,13 @@ class MESSAGE_CENTER_EXPORT NotificationMdTextButton ...@@ -70,11 +72,13 @@ class MESSAGE_CENTER_EXPORT NotificationMdTextButton
// line. This view is used for NOTIFICATION_TYPE_PROGRESS. // line. This view is used for NOTIFICATION_TYPE_PROGRESS.
class CompactTitleMessageView : public views::View { class CompactTitleMessageView : public views::View {
public: public:
METADATA_HEADER(CompactTitleMessageView);
CompactTitleMessageView(); CompactTitleMessageView();
CompactTitleMessageView(const CompactTitleMessageView&) = delete;
CompactTitleMessageView& operator=(const CompactTitleMessageView&) = delete;
~CompactTitleMessageView() override; ~CompactTitleMessageView() override;
const char* GetClassName() const override;
gfx::Size CalculatePreferredSize() const override; gfx::Size CalculatePreferredSize() const override;
void Layout() override; void Layout() override;
...@@ -84,19 +88,20 @@ class CompactTitleMessageView : public views::View { ...@@ -84,19 +88,20 @@ class CompactTitleMessageView : public views::View {
private: private:
views::Label* title_ = nullptr; views::Label* title_ = nullptr;
views::Label* message_ = nullptr; views::Label* message_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(CompactTitleMessageView);
}; };
class LargeImageView : public views::View { class LargeImageView : public views::View {
public: public:
METADATA_HEADER(LargeImageView);
explicit LargeImageView(const gfx::Size& max_size); explicit LargeImageView(const gfx::Size& max_size);
LargeImageView(const LargeImageView&) = delete;
LargeImageView& operator=(const LargeImageView&) = delete;
~LargeImageView() override; ~LargeImageView() override;
void SetImage(const gfx::ImageSkia& image); void SetImage(const gfx::ImageSkia& image);
void OnPaint(gfx::Canvas* canvas) override; void OnPaint(gfx::Canvas* canvas) override;
const char* GetClassName() const override;
void OnThemeChanged() override; void OnThemeChanged() override;
private: private:
...@@ -105,8 +110,6 @@ class LargeImageView : public views::View { ...@@ -105,8 +110,6 @@ class LargeImageView : public views::View {
gfx::Size max_size_; gfx::Size max_size_;
gfx::Size min_size_; gfx::Size min_size_;
gfx::ImageSkia image_; gfx::ImageSkia image_;
DISALLOW_COPY_AND_ASSIGN(LargeImageView);
}; };
class NotificationInputDelegate { class NotificationInputDelegate {
...@@ -119,7 +122,12 @@ class NotificationInputDelegate { ...@@ -119,7 +122,12 @@ class NotificationInputDelegate {
class NotificationInputContainerMD : public views::InkDropHostView, class NotificationInputContainerMD : public views::InkDropHostView,
public views::TextfieldController { public views::TextfieldController {
public: public:
METADATA_HEADER(NotificationInputContainerMD);
explicit NotificationInputContainerMD(NotificationInputDelegate* delegate); explicit NotificationInputContainerMD(NotificationInputDelegate* delegate);
NotificationInputContainerMD(const NotificationInputContainerMD&) = delete;
NotificationInputContainerMD& operator=(const NotificationInputContainerMD&) =
delete;
~NotificationInputContainerMD() override; ~NotificationInputContainerMD() override;
void AnimateBackground(const ui::Event& event); void AnimateBackground(const ui::Event& event);
...@@ -149,8 +157,6 @@ class NotificationInputContainerMD : public views::InkDropHostView, ...@@ -149,8 +157,6 @@ class NotificationInputContainerMD : public views::InkDropHostView,
views::Textfield* const textfield_; views::Textfield* const textfield_;
views::ImageButton* const button_; views::ImageButton* const button_;
DISALLOW_COPY_AND_ASSIGN(NotificationInputContainerMD);
}; };
// View that displays all current types of notification (web, basic, image, and // View that displays all current types of notification (web, basic, image, and
...@@ -162,6 +168,8 @@ class MESSAGE_CENTER_EXPORT NotificationViewMD ...@@ -162,6 +168,8 @@ class MESSAGE_CENTER_EXPORT NotificationViewMD
public views::InkDropObserver, public views::InkDropObserver,
public NotificationInputDelegate { public NotificationInputDelegate {
public: public:
METADATA_HEADER(NotificationViewMD);
// This defines an enumeration of IDs that can uniquely identify a view within // This defines an enumeration of IDs that can uniquely identify a view within
// the scope of NotificationViewMD. // the scope of NotificationViewMD.
enum ViewId { enum ViewId {
...@@ -174,6 +182,9 @@ class MESSAGE_CENTER_EXPORT NotificationViewMD ...@@ -174,6 +182,9 @@ class MESSAGE_CENTER_EXPORT NotificationViewMD
}; };
explicit NotificationViewMD(const Notification& notification); explicit NotificationViewMD(const Notification& notification);
NotificationViewMD(const NotificationViewMD&) = delete;
NotificationViewMD& operator=(const NotificationViewMD&) = delete;
~NotificationViewMD() override; ~NotificationViewMD() override;
void Activate(); void Activate();
...@@ -347,8 +358,6 @@ class MESSAGE_CENTER_EXPORT NotificationViewMD ...@@ -347,8 +358,6 @@ class MESSAGE_CENTER_EXPORT NotificationViewMD
base::TimeTicks last_mouse_pressed_timestamp_; base::TimeTicks last_mouse_pressed_timestamp_;
base::WeakPtrFactory<NotificationViewMD> weak_ptr_factory_{this}; base::WeakPtrFactory<NotificationViewMD> weak_ptr_factory_{this};
DISALLOW_COPY_AND_ASSIGN(NotificationViewMD);
}; };
} // namespace message_center } // 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