Commit 1b6fbd4f authored by Shengsong Tan's avatar Shengsong Tan Committed by Chromium LUCI CQ

Adding metadata to AssistantButton

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: Id54167a8b23b0e2cf0046de263510c7e3526f470
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2596711Reviewed-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@{#840892}
parent 87eb920b
......@@ -14,6 +14,7 @@
#include "ui/views/animation/flood_fill_ink_drop_ripple.h"
#include "ui/views/animation/ink_drop_impl.h"
#include "ui/views/controls/highlight_path_generator.h"
#include "ui/views/metadata/metadata_impl_macros.h"
namespace ash {
......@@ -87,10 +88,6 @@ std::unique_ptr<AssistantButton> AssistantButton::Create(
return button;
}
const char* AssistantButton::GetClassName() const {
return "AssistantButton";
}
void AssistantButton::OnBoundsChanged(const gfx::Rect& previous_bounds) {
// Note that the current assumption is that button bounds are square.
DCHECK_EQ(width(), height());
......@@ -127,4 +124,7 @@ void AssistantButton::OnButtonPressed() {
listener_->OnButtonPressed(id_);
}
BEGIN_METADATA(AssistantButton, views::ImageButton)
END_METADATA
} // namespace ash
......@@ -13,6 +13,7 @@
#include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/color_palette.h"
#include "ui/views/controls/button/image_button.h"
#include "ui/views/metadata/metadata_header_macros.h"
namespace gfx {
struct VectorIcon;
......@@ -30,6 +31,8 @@ enum class AssistantButtonId;
class COMPONENT_EXPORT(ASSISTANT_UI) AssistantButton
: public views::ImageButton {
public:
METADATA_HEADER(AssistantButton);
// Initialization parameters for customizing the Assistant button.
struct InitParams {
InitParams();
......@@ -68,8 +71,6 @@ class COMPONENT_EXPORT(ASSISTANT_UI) AssistantButton
AssistantButtonId GetAssistantButtonId() const { return id_; }
// views::Button:
const char* GetClassName() const override;
void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
std::unique_ptr<views::InkDrop> CreateInkDrop() override;
std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight()
......
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