Commit 4bd5d4ea authored by Shengsong Tan's avatar Shengsong Tan Committed by Chromium LUCI CQ

Adding metadata to ArrowButtonView

This is part of the "Views Posse" effort. See this document:
https://docs.google.com/document/d/1Rst3792TjXtVA8k8GXaPD8MnuB1JAneSOpIILdA4268/edit?usp=sharing

Bug: 1159562
Test: build
Change-Id: I4f9845c124968d4fa9e5a10683eadf24228e3868
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2603760Reviewed-by: default avatarAllen Bauer <kylixrd@chromium.org>
Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Commit-Queue: Shengsong Tan <sstan@google.com>
Cr-Commit-Position: refs/heads/master@{#840889}
parent e2bd1b90
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/paint_vector_icon.h"
#include "ui/gfx/skia_util.h" #include "ui/gfx/skia_util.h"
#include "ui/views/controls/highlight_path_generator.h" #include "ui/views/controls/highlight_path_generator.h"
#include "ui/views/metadata/metadata_impl_macros.h"
namespace ash { namespace ash {
namespace { namespace {
...@@ -104,10 +105,6 @@ void ArrowButtonView::GetAccessibleNodeData(ui::AXNodeData* node_data) { ...@@ -104,10 +105,6 @@ void ArrowButtonView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
node_data->SetNameExplicitlyEmpty(); node_data->SetNameExplicitlyEmpty();
} }
const char* ArrowButtonView::GetClassName() const {
return "ArrowButtonView";
}
void ArrowButtonView::SetBackgroundColor(SkColor color) { void ArrowButtonView::SetBackgroundColor(SkColor color) {
background_color_ = color; background_color_ = color;
SchedulePaint(); SchedulePaint();
...@@ -149,4 +146,7 @@ void ArrowButtonView::LoadingAnimationDelegate::AnimationProgressed( ...@@ -149,4 +146,7 @@ void ArrowButtonView::LoadingAnimationDelegate::AnimationProgressed(
owner_->SchedulePaint(); owner_->SchedulePaint();
} }
BEGIN_METADATA(ArrowButtonView, LoginButton)
END_METADATA
} // namespace ash } // namespace ash
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "ash/login/ui/login_button.h" #include "ash/login/ui/login_button.h"
#include "ui/gfx/animation/animation_delegate.h" #include "ui/gfx/animation/animation_delegate.h"
#include "ui/views/controls/image_view.h" #include "ui/views/controls/image_view.h"
#include "ui/views/metadata/metadata_header_macros.h"
namespace gfx { namespace gfx {
class MultiAnimation; class MultiAnimation;
...@@ -22,13 +23,16 @@ namespace ash { ...@@ -22,13 +23,16 @@ namespace ash {
// view. // view.
class ArrowButtonView : public LoginButton { class ArrowButtonView : public LoginButton {
public: public:
METADATA_HEADER(ArrowButtonView);
ArrowButtonView(PressedCallback callback, int size); ArrowButtonView(PressedCallback callback, int size);
ArrowButtonView(const ArrowButtonView&) = delete;
ArrowButtonView& operator=(const ArrowButtonView&) = delete;
~ArrowButtonView() override; ~ArrowButtonView() override;
// views::Button: // views::Button:
void PaintButtonContents(gfx::Canvas* canvas) override; void PaintButtonContents(gfx::Canvas* canvas) override;
void GetAccessibleNodeData(ui::AXNodeData* node_data) override; void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
const char* GetClassName() const override;
// Set background color of the button. // Set background color of the button.
void SetBackgroundColor(SkColor color); void SetBackgroundColor(SkColor color);
...@@ -59,8 +63,6 @@ class ArrowButtonView : public LoginButton { ...@@ -59,8 +63,6 @@ class ArrowButtonView : public LoginButton {
SkColor background_color_; SkColor background_color_;
LoadingAnimationDelegate loading_animation_delegate_{this}; LoadingAnimationDelegate loading_animation_delegate_{this};
std::unique_ptr<gfx::MultiAnimation> loading_animation_; std::unique_ptr<gfx::MultiAnimation> loading_animation_;
DISALLOW_COPY_AND_ASSIGN(ArrowButtonView);
}; };
} // namespace ash } // namespace ash
......
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