Revert "Add metadata for various View subclasses that lack it, 20/n"
This reverts commit bf15e1fc30
.
Reason for revert: The following tests fail by "Uninitialized value was created by a heap allocation".
- MediaNotificationViewModernImplTest.UnfreezingWaitsForArtwork_ReceiveArtwork
- MediaNotificationViewModernImplTest.UnfreezingWaitsForArtwork_Timeout
- MediaNotificationViewModernImplTest.UpdateArtworkFromItem
Build log: https://ci.chromium.org/ui/p/chromium/builders/ci/Linux%20ChromiumOS%20MSan%20Tests/22436/overview
Original change's description:
> Add metadata for various View subclasses that lack it, 20/n
>
> Bug: 1159562
> Change-Id: Id1b2cdf8595899e6d156393ac0f928ccb80aa4f9
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2679944
> Reviewed-by: Tommy Steimel <steimel@chromium.org>
> Reviewed-by: Allen Bauer <kylixrd@chromium.org>
> Reviewed-by: Dominique Fauteux-Chapleau <domfc@chromium.org>
> Reviewed-by: Justin DeWitt <dewittj@chromium.org>
> Commit-Queue: Peter Kasting <pkasting@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#851895}
TBR=pkasting@chromium.org,dewittj@chromium.org,kylixrd@chromium.org,steimel@chromium.org,chromium-scoped@luci-project-accounts.iam.gserviceaccount.com,domfc@chromium.org
Change-Id: I27f2c4244408177fb86219374d77b33debf763be
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1159562
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2683656
Reviewed-by: Asami Doi <asamidoi@chromium.org>
Commit-Queue: Asami Doi <asamidoi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#852105}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
4c13d9af16
commit
02dbd1fa1c
chrome/browser
enterprise
connectors
analysis
ui
views
accessibility
download
omnibox
passwords
profiles
components/media_message_center
ui/message_center/views
@ -39,8 +39,6 @@
|
||||
#include "ui/views/layout/box_layout.h"
|
||||
#include "ui/views/layout/fill_layout.h"
|
||||
#include "ui/views/layout/grid_layout.h"
|
||||
#include "ui/views/metadata/metadata_header_macros.h"
|
||||
#include "ui/views/metadata/metadata_impl_macros.h"
|
||||
|
||||
namespace enterprise_connectors {
|
||||
|
||||
@ -105,8 +103,6 @@ class DeepScanningBaseView {
|
||||
class DeepScanningTopImageView : public DeepScanningBaseView,
|
||||
public views::ImageView {
|
||||
public:
|
||||
METADATA_HEADER(DeepScanningTopImageView);
|
||||
|
||||
using DeepScanningBaseView::DeepScanningBaseView;
|
||||
|
||||
void Update() { SetImage(dialog()->GetTopImage()); }
|
||||
@ -118,14 +114,9 @@ class DeepScanningTopImageView : public DeepScanningBaseView,
|
||||
}
|
||||
};
|
||||
|
||||
BEGIN_METADATA(DeepScanningTopImageView, views::ImageView)
|
||||
END_METADATA
|
||||
|
||||
class DeepScanningSideIconImageView : public DeepScanningBaseView,
|
||||
public views::ImageView {
|
||||
public:
|
||||
METADATA_HEADER(DeepScanningSideIconImageView);
|
||||
|
||||
using DeepScanningBaseView::DeepScanningBaseView;
|
||||
|
||||
void Update() {
|
||||
@ -144,14 +135,9 @@ class DeepScanningSideIconImageView : public DeepScanningBaseView,
|
||||
}
|
||||
};
|
||||
|
||||
BEGIN_METADATA(DeepScanningSideIconImageView, views::ImageView)
|
||||
END_METADATA
|
||||
|
||||
class DeepScanningSideIconSpinnerView : public DeepScanningBaseView,
|
||||
public views::Throbber {
|
||||
public:
|
||||
METADATA_HEADER(DeepScanningSideIconSpinnerView);
|
||||
|
||||
using DeepScanningBaseView::DeepScanningBaseView;
|
||||
|
||||
void Update() {
|
||||
@ -168,14 +154,9 @@ class DeepScanningSideIconSpinnerView : public DeepScanningBaseView,
|
||||
}
|
||||
};
|
||||
|
||||
BEGIN_METADATA(DeepScanningSideIconSpinnerView, views::Throbber)
|
||||
END_METADATA
|
||||
|
||||
class DeepScanningMessageView : public DeepScanningBaseView,
|
||||
public views::Label {
|
||||
public:
|
||||
METADATA_HEADER(DeepScanningMessageView);
|
||||
|
||||
using DeepScanningBaseView::DeepScanningBaseView;
|
||||
|
||||
void Update() {
|
||||
@ -190,9 +171,6 @@ class DeepScanningMessageView : public DeepScanningBaseView,
|
||||
}
|
||||
};
|
||||
|
||||
BEGIN_METADATA(DeepScanningMessageView, views::Label)
|
||||
END_METADATA
|
||||
|
||||
// static
|
||||
base::TimeDelta ContentAnalysisDialog::GetMinimumPendingDialogTime() {
|
||||
return minimum_pending_dialog_time_;
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
#include "ui/accessibility/ax_enums.mojom.h"
|
||||
#include "ui/accessibility/ax_node_data.h"
|
||||
#include "ui/views/metadata/metadata_impl_macros.h"
|
||||
|
||||
NonAccessibleImageView::NonAccessibleImageView() {}
|
||||
|
||||
@ -15,6 +14,3 @@ NonAccessibleImageView::~NonAccessibleImageView() {}
|
||||
void NonAccessibleImageView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
|
||||
node_data->AddState(ax::mojom::State::kInvisible);
|
||||
}
|
||||
|
||||
BEGIN_METADATA(NonAccessibleImageView, views::ImageView)
|
||||
END_METADATA
|
||||
|
@ -7,21 +7,19 @@
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "ui/views/controls/image_view.h"
|
||||
#include "ui/views/metadata/metadata_header_macros.h"
|
||||
|
||||
// ImageView that sets the "invisible" state on AXNodeData so that
|
||||
// the image is not traversed by screen readers.
|
||||
class NonAccessibleImageView : public views::ImageView {
|
||||
public:
|
||||
METADATA_HEADER(NonAccessibleImageView);
|
||||
NonAccessibleImageView();
|
||||
NonAccessibleImageView(const NonAccessibleImageView&) = delete;
|
||||
NonAccessibleImageView& operator=(const NonAccessibleImageView&) = delete;
|
||||
~NonAccessibleImageView() override;
|
||||
|
||||
private:
|
||||
// Overridden from views::ImageView.
|
||||
void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(NonAccessibleImageView);
|
||||
};
|
||||
|
||||
#endif // CHROME_BROWSER_UI_VIEWS_ACCESSIBILITY_NON_ACCESSIBLE_IMAGE_VIEW_H_
|
||||
|
@ -14,8 +14,6 @@
|
||||
#include "ui/gfx/geometry/rect.h"
|
||||
#include "ui/gfx/paint_vector_icon.h"
|
||||
#include "ui/views/controls/image_view.h"
|
||||
#include "ui/views/metadata/metadata_header_macros.h"
|
||||
#include "ui/views/metadata/metadata_impl_macros.h"
|
||||
#include "ui/views/widget/widget.h"
|
||||
|
||||
// How long to spend moving downwards and fading out after waiting.
|
||||
@ -34,11 +32,7 @@ namespace {
|
||||
class DownloadStartedAnimationViews : public gfx::LinearAnimation,
|
||||
public views::ImageView {
|
||||
public:
|
||||
METADATA_HEADER(DownloadStartedAnimationViews);
|
||||
explicit DownloadStartedAnimationViews(content::WebContents* web_contents);
|
||||
DownloadStartedAnimationViews(const DownloadStartedAnimationViews&) = delete;
|
||||
DownloadStartedAnimationViews& operator=(
|
||||
const DownloadStartedAnimationViews&) = delete;
|
||||
|
||||
private:
|
||||
// Move the animation to wherever it should currently be.
|
||||
@ -60,6 +54,8 @@ class DownloadStartedAnimationViews : public gfx::LinearAnimation,
|
||||
// with the parent window, but it's so fast that this shouldn't cause too
|
||||
// much heartbreak.
|
||||
gfx::Rect web_contents_bounds_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(DownloadStartedAnimationViews);
|
||||
};
|
||||
|
||||
DownloadStartedAnimationViews::DownloadStartedAnimationViews(
|
||||
@ -121,9 +117,6 @@ void DownloadStartedAnimationViews::AnimateToState(double state) {
|
||||
}
|
||||
}
|
||||
|
||||
BEGIN_METADATA(DownloadStartedAnimationViews, views::ImageView)
|
||||
END_METADATA
|
||||
|
||||
} // namespace
|
||||
|
||||
// static
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include "ui/views/border.h"
|
||||
#include "ui/views/controls/image_view.h"
|
||||
#include "ui/views/layout/layout_provider.h"
|
||||
#include "ui/views/metadata/metadata_header_macros.h"
|
||||
#include "ui/views/metadata/metadata_impl_macros.h"
|
||||
|
||||
namespace {
|
||||
@ -46,8 +45,6 @@ static constexpr int kEntityImageSize = 32;
|
||||
class PlaceholderImageSource : public gfx::CanvasImageSource {
|
||||
public:
|
||||
PlaceholderImageSource(const gfx::Size& canvas_size, SkColor color);
|
||||
PlaceholderImageSource(const PlaceholderImageSource&) = delete;
|
||||
PlaceholderImageSource& operator=(const PlaceholderImageSource&) = delete;
|
||||
~PlaceholderImageSource() override = default;
|
||||
|
||||
// gfx::CanvasImageSource:
|
||||
@ -55,6 +52,8 @@ class PlaceholderImageSource : public gfx::CanvasImageSource {
|
||||
|
||||
private:
|
||||
const SkColor color_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(PlaceholderImageSource);
|
||||
};
|
||||
|
||||
PlaceholderImageSource::PlaceholderImageSource(const gfx::Size& canvas_size,
|
||||
@ -77,10 +76,7 @@ void PlaceholderImageSource::Draw(gfx::Canvas* canvas) {
|
||||
|
||||
class RoundedCornerImageView : public views::ImageView {
|
||||
public:
|
||||
METADATA_HEADER(RoundedCornerImageView);
|
||||
RoundedCornerImageView() = default;
|
||||
RoundedCornerImageView(const RoundedCornerImageView&) = delete;
|
||||
RoundedCornerImageView& operator=(const RoundedCornerImageView&) = delete;
|
||||
|
||||
// views::ImageView:
|
||||
bool GetCanProcessEventsWithinSubtree() const override { return false; }
|
||||
@ -88,6 +84,9 @@ class RoundedCornerImageView : public views::ImageView {
|
||||
protected:
|
||||
// views::ImageView:
|
||||
void OnPaint(gfx::Canvas* canvas) override;
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(RoundedCornerImageView);
|
||||
};
|
||||
|
||||
void RoundedCornerImageView::OnPaint(gfx::Canvas* canvas) {
|
||||
@ -100,9 +99,6 @@ void RoundedCornerImageView::OnPaint(gfx::Canvas* canvas) {
|
||||
ImageView::OnPaint(canvas);
|
||||
}
|
||||
|
||||
BEGIN_METADATA(RoundedCornerImageView, views::ImageView)
|
||||
END_METADATA
|
||||
|
||||
} // namespace
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -26,22 +26,19 @@
|
||||
#include "ui/views/controls/image_view.h"
|
||||
#include "ui/views/controls/label.h"
|
||||
#include "ui/views/layout/box_layout.h"
|
||||
#include "ui/views/metadata/metadata_header_macros.h"
|
||||
#include "ui/views/metadata/metadata_impl_macros.h"
|
||||
#include "ui/views/view_class_properties.h"
|
||||
|
||||
namespace {
|
||||
|
||||
class CircularImageView : public views::ImageView {
|
||||
public:
|
||||
METADATA_HEADER(CircularImageView);
|
||||
CircularImageView() = default;
|
||||
CircularImageView(const CircularImageView&) = delete;
|
||||
CircularImageView& operator=(const CircularImageView&) = delete;
|
||||
|
||||
private:
|
||||
// views::ImageView:
|
||||
void OnPaint(gfx::Canvas* canvas) override;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CircularImageView);
|
||||
};
|
||||
|
||||
void CircularImageView::OnPaint(gfx::Canvas* canvas) {
|
||||
@ -56,9 +53,6 @@ void CircularImageView::OnPaint(gfx::Canvas* canvas) {
|
||||
ImageView::OnPaint(canvas);
|
||||
}
|
||||
|
||||
BEGIN_METADATA(CircularImageView, views::ImageView)
|
||||
END_METADATA
|
||||
|
||||
} // namespace
|
||||
|
||||
CredentialsItemView::CredentialsItemView(
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "ui/gfx/paint_vector_icon.h"
|
||||
#include "ui/native_theme/native_theme.h"
|
||||
#include "ui/views/controls/image_view.h"
|
||||
#include "ui/views/metadata/metadata_header_macros.h"
|
||||
#include "ui/views/metadata/metadata_impl_macros.h"
|
||||
|
||||
namespace {
|
||||
@ -32,18 +31,14 @@ constexpr int kBadgedProfilePhotoHeight = BadgedProfilePhoto::kImageSize;
|
||||
// including the (transparent) border.
|
||||
class CustomImageView : public views::ImageView {
|
||||
public:
|
||||
METADATA_HEADER(CustomImageView);
|
||||
CustomImageView() = default;
|
||||
CustomImageView(const CustomImageView&) = delete;
|
||||
CustomImageView& operator=(const CustomImageView&) = delete;
|
||||
|
||||
private:
|
||||
// views::ImageView:
|
||||
void OnPaint(gfx::Canvas* canvas) override;
|
||||
};
|
||||
|
||||
BEGIN_METADATA(CustomImageView, views::ImageView)
|
||||
END_METADATA
|
||||
DISALLOW_COPY_AND_ASSIGN(CustomImageView);
|
||||
};
|
||||
|
||||
void CustomImageView::OnPaint(gfx::Canvas* canvas) {
|
||||
// Remove the part of the ImageView that contains the badge.
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include "ui/views/border.h"
|
||||
#include "ui/views/controls/button/image_button_factory.h"
|
||||
#include "ui/views/layout/box_layout.h"
|
||||
#include "ui/views/metadata/metadata_header_macros.h"
|
||||
#include "ui/views/metadata/metadata_impl_macros.h"
|
||||
#include "ui/views/style/typography.h"
|
||||
#include "ui/views/view_class_properties.h"
|
||||
@ -62,17 +61,12 @@ constexpr int kMediaButtonIconSize = 20;
|
||||
// An image view with a rounded rectangle vignette
|
||||
class MediaArtworkView : public views::ImageView {
|
||||
public:
|
||||
METADATA_HEADER(MediaArtworkView);
|
||||
explicit MediaArtworkView(float corner_radius)
|
||||
: corner_radius_(corner_radius) {}
|
||||
|
||||
void SetVignetteColor(const SkColor& vignette_color) {
|
||||
if (vignette_color_ == vignette_color)
|
||||
return;
|
||||
vignette_color_ = vignette_color;
|
||||
OnPropertyChanged(&vignette_color_, views::kPropertyEffectsPaint);
|
||||
}
|
||||
SkColor GetVignetteColor() const { return vignette_color_; }
|
||||
|
||||
// ImageView
|
||||
void OnPaint(gfx::Canvas* canvas) override;
|
||||
@ -82,10 +76,6 @@ class MediaArtworkView : public views::ImageView {
|
||||
float corner_radius_;
|
||||
};
|
||||
|
||||
BEGIN_METADATA(MediaArtworkView, views::ImageView)
|
||||
ADD_PROPERTY_METADATA(SkColor, VignetteColor)
|
||||
END_METADATA
|
||||
|
||||
void MediaArtworkView::OnPaint(gfx::Canvas* canvas) {
|
||||
views::ImageView::OnPaint(canvas);
|
||||
auto path = SkPath().addRoundRect(RectToSkRect(GetLocalBounds()),
|
||||
|
@ -27,8 +27,6 @@
|
||||
#include "ui/views/controls/label.h"
|
||||
#include "ui/views/layout/flex_layout.h"
|
||||
#include "ui/views/layout/flex_layout_types.h"
|
||||
#include "ui/views/metadata/metadata_header_macros.h"
|
||||
#include "ui/views/metadata/metadata_impl_macros.h"
|
||||
#include "ui/views/painter.h"
|
||||
#include "ui/views/view_class_properties.h"
|
||||
|
||||
@ -77,7 +75,6 @@ constexpr int kControlButtonSpacing = 16;
|
||||
// takes tab focus for accessibility purpose.
|
||||
class ExpandButton : public views::ImageView {
|
||||
public:
|
||||
METADATA_HEADER(ExpandButton);
|
||||
ExpandButton();
|
||||
~ExpandButton() override;
|
||||
|
||||
@ -128,9 +125,6 @@ void ExpandButton::GetAccessibleNodeData(ui::AXNodeData* node_data) {
|
||||
node_data->SetName(GetTooltipText(gfx::Point()));
|
||||
}
|
||||
|
||||
BEGIN_METADATA(ExpandButton, views::ImageView)
|
||||
END_METADATA
|
||||
|
||||
gfx::FontList GetHeaderTextFontList() {
|
||||
gfx::Font default_font;
|
||||
int font_size_delta = kHeaderTextFontSize - default_font.GetFontSize();
|
||||
|
Reference in New Issue
Block a user