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

apply views-posse to ash/ambient/ui

Bug: crbug.com/1159562
Change-Id: I6a7cf914b2f2b5c35afc5d4a48025a2aaef033c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2612673Reviewed-by: default avatarJeroen Dhollander <jeroendh@chromium.org>
Reviewed-by: default avatarAllen Bauer <kylixrd@chromium.org>
Commit-Queue: Sara Kato <sarakato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#842279}
parent dbc901b2
......@@ -15,6 +15,7 @@
#include "ash/assistant/ui/main_stage/assistant_text_element_view.h"
#include "ash/assistant/ui/main_stage/element_animator.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/metadata/metadata_impl_macros.h"
namespace ash {
......@@ -34,10 +35,6 @@ AssistantResponseContainerView::AssistantResponseContainerView(
AssistantResponseContainerView::~AssistantResponseContainerView() = default;
const char* AssistantResponseContainerView::GetClassName() const {
return "AssistantResponseContainerView";
}
gfx::Size AssistantResponseContainerView::CalculatePreferredSize() const {
return gfx::Size(kPreferredWidthDip,
content_view()->GetHeightForWidth(kPreferredWidthDip));
......@@ -88,4 +85,7 @@ void AssistantResponseContainerView::AddErrorElementView(
std::make_unique<AssistantErrorElementView>(error_element));
}
BEGIN_METADATA(AssistantResponseContainerView, AnimatedContainerView)
END_METADATA
} // namespace ash
......@@ -8,7 +8,6 @@
#include <memory>
#include "ash/assistant/ui/main_stage/animated_container_view.h"
#include "base/macros.h"
namespace ash {
......@@ -18,11 +17,16 @@ class AssistantViewDelegate;
class AssistantResponseContainerView : public AnimatedContainerView {
public:
METADATA_HEADER(AssistantResponseContainerView);
explicit AssistantResponseContainerView(AssistantViewDelegate* delegate);
AssistantResponseContainerView(const AssistantResponseContainerView&) =
delete;
AssistantResponseContainerView& operator=(
const AssistantResponseContainerView&) = delete;
~AssistantResponseContainerView() override;
// AnimatedContainerView:
const char* GetClassName() const override;
gfx::Size CalculatePreferredSize() const override;
void OnContentsPreferredSizeChanged(views::View* content_view) override;
......@@ -34,8 +38,6 @@ class AssistantResponseContainerView : public AnimatedContainerView {
// AnimatedContainerView:
std::unique_ptr<ElementAnimator> HandleUiElement(
const AssistantUiElement* ui_element) override;
DISALLOW_COPY_AND_ASSIGN(AssistantResponseContainerView);
};
} // namespace ash
......
......@@ -30,6 +30,7 @@
#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_impl_macros.h"
#include "ui/views/view.h"
namespace ash {
......@@ -86,11 +87,6 @@ GlanceableInfoView::GlanceableInfoView(AmbientViewDelegate* delegate)
}
GlanceableInfoView::~GlanceableInfoView() = default;
const char* GlanceableInfoView::GetClassName() const {
return "GlanceableInfoView";
}
void GlanceableInfoView::OnWeatherInfoUpdated() {
Show();
}
......@@ -174,4 +170,7 @@ void GlanceableInfoView::InitLayout() {
0, 0, GetTimeFontDescent() - GetTemperatureFontDescent(), 0));
}
BEGIN_METADATA(GlanceableInfoView, views::View)
END_METADATA
} // namespace ash
......@@ -27,14 +27,13 @@ class AmbientViewDelegate;
class GlanceableInfoView : public views::View,
public AmbientBackendModelObserver {
public:
METADATA_HEADER(GlanceableInfoView);
explicit GlanceableInfoView(AmbientViewDelegate* delegate);
GlanceableInfoView(const GlanceableInfoView&) = delete;
GlanceableInfoView& operator=(const GlanceableInfoView&) = delete;
~GlanceableInfoView() override;
// views::View:
const char* GetClassName() const override;
// AmbientBackendModelObserver:
void OnWeatherInfoUpdated() override;
......
......@@ -36,6 +36,7 @@
#include "ui/views/layout/box_layout.h"
#include "ui/views/layout/flex_layout.h"
#include "ui/views/layout/flex_layout_types.h"
#include "ui/views/metadata/metadata_impl_macros.h"
namespace ash {
......@@ -45,7 +46,7 @@ namespace {
// zones.
class FadeoutLayerDelegate : public ui::LayerDelegate {
public:
explicit FadeoutLayerDelegate() : layer_(ui::LAYER_TEXTURED) {
FadeoutLayerDelegate() : layer_(ui::LAYER_TEXTURED) {
layer_.set_delegate(this);
layer_.SetFillsBoundsOpaquely(false);
}
......@@ -124,10 +125,6 @@ MediaStringView::MediaStringView() {
MediaStringView::~MediaStringView() = default;
const char* MediaStringView::GetClassName() const {
return "MediaStringView";
}
void MediaStringView::OnViewBoundsChanged(views::View* observed_view) {
UpdateMaskLayer();
}
......@@ -344,4 +341,7 @@ void MediaStringView::StartScrolling(bool is_initial) {
}
}
BEGIN_METADATA(MediaStringView, views::View)
END_METADATA
} // namespace ash
......@@ -34,14 +34,13 @@ class MediaStringView : public views::View,
public media_session::mojom::MediaControllerObserver,
public ui::ImplicitAnimationObserver {
public:
METADATA_HEADER(MediaStringView);
MediaStringView();
MediaStringView(const MediaStringView&) = delete;
MediaStringView& operator=(const MediaStringView&) = delete;
~MediaStringView() override;
// views::View:
const char* GetClassName() const override;
// views::ViewObserver:
void OnViewBoundsChanged(views::View* observed_view) override;
......
......@@ -22,6 +22,7 @@
#include "ui/compositor/scoped_layer_animation_settings.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/metadata/metadata_impl_macros.h"
namespace ash {
......@@ -46,10 +47,6 @@ PhotoView::PhotoView(AmbientViewDelegate* delegate) : delegate_(delegate) {
PhotoView::~PhotoView() = default;
const char* PhotoView::GetClassName() const {
return "PhotoView";
}
void PhotoView::OnImageAdded() {
// If NeedToAnimate() is true, will start transition animation and
// UpdateImages() when animation completes. Otherwise, update images
......@@ -152,4 +149,7 @@ const gfx::ImageSkia& PhotoView::GetVisibleImageForTesting() {
return image_views_.at(image_index_)->GetCurrentImage();
}
BEGIN_METADATA(PhotoView, views::View)
END_METADATA
} // namespace ash
......@@ -32,14 +32,13 @@ class ASH_EXPORT PhotoView : public views::View,
public AmbientBackendModelObserver,
public ui::ImplicitAnimationObserver {
public:
METADATA_HEADER(PhotoView);
explicit PhotoView(AmbientViewDelegate* delegate);
PhotoView(const PhotoView&) = delete;
PhotoView& operator=(PhotoView&) = delete;
~PhotoView() override;
// views::View:
const char* GetClassName() const override;
// AmbientBackendModelObserver:
void OnImageAdded() override;
......
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