Commit 70da09c1 authored by Maggie Cai's avatar Maggie Cai Committed by Chromium LUCI CQ

Revert "views-posse: Add metadata to notification_view_md"

This reverts commit 21a8ee36.

Reason for revert: This CL is likely the culprit for the failure of tests: AssistantTimersBrowserTest.ShouldRemoveTimerWhenStoppingViaNotification

AssistantTimersBrowserTest.ShouldTickNotificationsAtRegularIntervals
on builder linux-chromeos-chrome
First occurance: https://ci.chromium.org/p/chrome/builders/ci/linux-chromeos-chrome/11466

Original change's description:
> 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/+/2615725
> Reviewed-by: Yoshiki Iguchi <yoshiki@chromium.org>
> Reviewed-by: Allen Bauer <kylixrd@chromium.org>
> Commit-Queue: Sara Kato <sarakato@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#844496}

TBR=yoshiki@chromium.org,kylixrd@chromium.org,sarakato@chromium.org,chromium-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I3fe76cb2391afb9ef454f3e3fb8d8c44c6753013
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1159562
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2636737Reviewed-by: default avatarMaggie Cai <mxcai@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Maggie Cai <mxcai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#844674}
parent a40ca8f5
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#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"
...@@ -76,6 +75,8 @@ bool ShouldShowAeroShadowBorder() { ...@@ -76,6 +75,8 @@ 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(
...@@ -280,6 +281,10 @@ void MessageView::OnBlur() { ...@@ -280,6 +281,10 @@ 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: {
...@@ -487,7 +492,4 @@ void MessageView::SetDrawBackgroundAsActive(bool active) { ...@@ -487,7 +492,4 @@ 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:
METADATA_HEADER(MessageView); static const char kViewClassName[];
class Observer : public base::CheckedObserver { class Observer : public base::CheckedObserver {
public: public:
...@@ -83,8 +83,6 @@ class MESSAGE_CENTER_EXPORT MessageView ...@@ -83,8 +83,6 @@ 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.
...@@ -131,6 +129,7 @@ class MESSAGE_CENTER_EXPORT MessageView ...@@ -131,6 +129,7 @@ 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:
...@@ -239,6 +238,7 @@ class MESSAGE_CENTER_EXPORT MessageView ...@@ -239,6 +238,7 @@ 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,6 +188,10 @@ std::unique_ptr<ui::Event> ConvertToBoundedLocatedEvent(const ui::Event& event, ...@@ -188,6 +188,10 @@ 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));
...@@ -236,9 +240,6 @@ void CompactTitleMessageView::set_message(const base::string16& message) { ...@@ -236,9 +240,6 @@ 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)
...@@ -275,6 +276,10 @@ void LargeImageView::OnPaint(gfx::Canvas* canvas) { ...@@ -275,6 +276,10 @@ 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(
...@@ -297,9 +302,6 @@ gfx::Size LargeImageView::GetResizedImageSize() { ...@@ -297,9 +302,6 @@ gfx::Size LargeImageView::GetResizedImageSize() {
return resized_size; return resized_size;
} }
BEGIN_METADATA(LargeImageView, views::View)
END_METADATA
// NotificationMDTextButton //////////////////////////////////////////////// // NotificationMDTextButton ////////////////////////////////////////////////
NotificationMdTextButton::NotificationMdTextButton( NotificationMdTextButton::NotificationMdTextButton(
...@@ -459,9 +461,6 @@ void NotificationInputContainerMD::SetButtonImage() { ...@@ -459,9 +461,6 @@ 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 {
...@@ -1491,7 +1490,4 @@ void NotificationViewMD::InkDropRippleAnimationEnded( ...@@ -1491,7 +1490,4 @@ void NotificationViewMD::InkDropRippleAnimationEnded(
header_row_->SetSubpixelRenderingEnabled(true); header_row_->SetSubpixelRenderingEnabled(true);
} }
BEGIN_METADATA(NotificationViewMD, MessageView)
END_METADATA
} // namespace message_center } // namespace message_center
...@@ -43,8 +43,6 @@ class MESSAGE_CENTER_EXPORT NotificationMdTextButton ...@@ -43,8 +43,6 @@ 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:
...@@ -72,13 +70,11 @@ class MESSAGE_CENTER_EXPORT NotificationMdTextButton ...@@ -72,13 +70,11 @@ 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;
...@@ -88,20 +84,19 @@ class CompactTitleMessageView : public views::View { ...@@ -88,20 +84,19 @@ 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:
...@@ -110,6 +105,8 @@ class LargeImageView : public views::View { ...@@ -110,6 +105,8 @@ 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 {
...@@ -122,12 +119,7 @@ class NotificationInputDelegate { ...@@ -122,12 +119,7 @@ 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);
...@@ -157,6 +149,8 @@ class NotificationInputContainerMD : public views::InkDropHostView, ...@@ -157,6 +149,8 @@ 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
...@@ -168,8 +162,6 @@ class MESSAGE_CENTER_EXPORT NotificationViewMD ...@@ -168,8 +162,6 @@ 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 {
...@@ -182,9 +174,6 @@ class MESSAGE_CENTER_EXPORT NotificationViewMD ...@@ -182,9 +174,6 @@ 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();
...@@ -358,6 +347,8 @@ class MESSAGE_CENTER_EXPORT NotificationViewMD ...@@ -358,6 +347,8 @@ 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