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

Adding metadata to MicView

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: I4a9cb578e0cc7af1eb78d1af4f7c9c7b92926ebb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2602959Reviewed-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@{#840890}
parent 4bd5d4ea
......@@ -13,6 +13,7 @@
#include "ash/public/cpp/assistant/controller/assistant_ui_controller.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/metadata/metadata_impl_macros.h"
namespace ash {
......@@ -41,10 +42,6 @@ MicView::~MicView() {
AssistantInteractionController::Get()->GetModel()->RemoveObserver(this);
}
const char* MicView::GetClassName() const {
return "MicView";
}
gfx::Size MicView::CalculatePreferredSize() const {
return gfx::Size(kPreferredSizeDip, GetHeightForWidth(kPreferredSizeDip));
}
......@@ -127,4 +124,7 @@ void MicView::UpdateState(bool animate) {
logo_view_->SetState(mic_state, animate);
}
BEGIN_METADATA(MicView, AssistantButton)
END_METADATA
} // namespace ash
......@@ -12,6 +12,7 @@
#include "base/component_export.h"
#include "base/macros.h"
#include "base/scoped_observer.h"
#include "ui/views/metadata/metadata_header_macros.h"
namespace ash {
......@@ -24,12 +25,14 @@ class COMPONENT_EXPORT(ASSISTANT_UI) MicView
public AssistantControllerObserver,
public AssistantInteractionModelObserver {
public:
METADATA_HEADER(MicView);
MicView(AssistantButtonListener* listener,
AssistantButtonId button_id);
MicView(const MicView&) = delete;
MicView& operator=(const MicView&) = delete;
~MicView() override;
// AssistantButton:
const char* GetClassName() const override;
gfx::Size CalculatePreferredSize() const override;
int GetHeightForWidth(int width) const override;
......@@ -57,8 +60,6 @@ class COMPONENT_EXPORT(ASSISTANT_UI) MicView
ScopedObserver<AssistantController, AssistantControllerObserver>
assistant_controller_observer_{this};
DISALLOW_COPY_AND_ASSIGN(MicView);
};
} // 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