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

views-posse ash/ambient/ui

Bug: crbug.com/1159562
Change-Id: Ifffe7c432a6516fad11ce5175073f20f6073915e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2612288Reviewed-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@{#840881}
parent 33a34647
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "ui/views/controls/image_view.h" #include "ui/views/controls/image_view.h"
#include "ui/views/controls/label.h" #include "ui/views/controls/label.h"
#include "ui/views/layout/box_layout.h" #include "ui/views/layout/box_layout.h"
#include "ui/views/metadata/metadata_impl_macros.h"
namespace ash { namespace ash {
...@@ -58,10 +59,6 @@ AmbientAssistantContainerView::~AmbientAssistantContainerView() { ...@@ -58,10 +59,6 @@ AmbientAssistantContainerView::~AmbientAssistantContainerView() {
AssistantUiController::Get()->GetModel()->RemoveObserver(this); AssistantUiController::Get()->GetModel()->RemoveObserver(this);
} }
const char* AmbientAssistantContainerView::GetClassName() const {
return "AmbientAssistantContainerView";
}
void AmbientAssistantContainerView::OnAssistantControllerDestroying() { void AmbientAssistantContainerView::OnAssistantControllerDestroying() {
AssistantUiController::Get()->GetModel()->RemoveObserver(this); AssistantUiController::Get()->GetModel()->RemoveObserver(this);
assistant_controller_observer_.Remove(AssistantController::Get()); assistant_controller_observer_.Remove(AssistantController::Get());
...@@ -146,4 +143,6 @@ void AmbientAssistantContainerView::InitLayout() { ...@@ -146,4 +143,6 @@ void AmbientAssistantContainerView::InitLayout() {
avatar_view_->SetClipPath(circular_mask); avatar_view_->SetClipPath(circular_mask);
} }
BEGIN_METADATA(AmbientAssistantContainerView, views::View)
END_METADATA
} // namespace ash } // namespace ash
...@@ -27,12 +27,11 @@ class AmbientAssistantContainerView : public views::View, ...@@ -27,12 +27,11 @@ class AmbientAssistantContainerView : public views::View,
public AssistantControllerObserver, public AssistantControllerObserver,
public AssistantUiModelObserver { public AssistantUiModelObserver {
public: public:
METADATA_HEADER(AmbientAssistantContainerView);
AmbientAssistantContainerView(); AmbientAssistantContainerView();
~AmbientAssistantContainerView() override; ~AmbientAssistantContainerView() override;
// views::View:
const char* GetClassName() const override;
// AssistantControllerObserver: // AssistantControllerObserver:
void OnAssistantControllerDestroying() override; void OnAssistantControllerDestroying() override;
...@@ -58,7 +57,6 @@ class AmbientAssistantContainerView : public views::View, ...@@ -58,7 +57,6 @@ class AmbientAssistantContainerView : public views::View,
ScopedObserver<AssistantController, AssistantControllerObserver> ScopedObserver<AssistantController, AssistantControllerObserver>
assistant_controller_observer_{this}; assistant_controller_observer_{this};
DISALLOW_COPY_AND_ASSIGN(AmbientAssistantContainerView);
}; };
} // namespace ash } // namespace ash
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "ash/strings/grit/ash_strings.h" #include "ash/strings/grit/ash_strings.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/views/layout/box_layout.h" #include "ui/views/layout/box_layout.h"
#include "ui/views/metadata/metadata_impl_macros.h"
namespace ash { namespace ash {
...@@ -35,10 +36,6 @@ AmbientAssistantDialogPlate::~AmbientAssistantDialogPlate() { ...@@ -35,10 +36,6 @@ AmbientAssistantDialogPlate::~AmbientAssistantDialogPlate() {
AssistantInteractionController::Get()->GetModel()->RemoveObserver(this); AssistantInteractionController::Get()->GetModel()->RemoveObserver(this);
} }
const char* AmbientAssistantDialogPlate::GetClassName() const {
return "AmbientAssistantDialogPlate";
}
void AmbientAssistantDialogPlate::OnButtonPressed(AssistantButtonId button_id) { void AmbientAssistantDialogPlate::OnButtonPressed(AssistantButtonId button_id) {
delegate_->OnDialogPlateButtonPressed(button_id); delegate_->OnDialogPlateButtonPressed(button_id);
} }
...@@ -75,4 +72,7 @@ void AmbientAssistantDialogPlate::InitLayout() { ...@@ -75,4 +72,7 @@ void AmbientAssistantDialogPlate::InitLayout() {
voice_query_view_ = AddChildView(std::make_unique<AssistantQueryView>()); voice_query_view_ = AddChildView(std::make_unique<AssistantQueryView>());
} }
BEGIN_METADATA(AmbientAssistantDialogPlate, views::View)
END_METADATA
} // namespace ash } // namespace ash
...@@ -24,12 +24,11 @@ class AmbientAssistantDialogPlate : public views::View, ...@@ -24,12 +24,11 @@ class AmbientAssistantDialogPlate : public views::View,
public AssistantControllerObserver, public AssistantControllerObserver,
public AssistantInteractionModelObserver { public AssistantInteractionModelObserver {
public: public:
METADATA_HEADER(AmbientAssistantDialogPlate);
explicit AmbientAssistantDialogPlate(AssistantViewDelegate* delegate); explicit AmbientAssistantDialogPlate(AssistantViewDelegate* delegate);
~AmbientAssistantDialogPlate() override; ~AmbientAssistantDialogPlate() override;
// views::View:
const char* GetClassName() const override;
// AssistantButtonListener: // AssistantButtonListener:
void OnButtonPressed(AssistantButtonId button_id) override; void OnButtonPressed(AssistantButtonId button_id) override;
...@@ -52,7 +51,6 @@ class AmbientAssistantDialogPlate : public views::View, ...@@ -52,7 +51,6 @@ class AmbientAssistantDialogPlate : public views::View,
ScopedObserver<AssistantController, AssistantControllerObserver> ScopedObserver<AssistantController, AssistantControllerObserver>
assistant_controller_observer_{this}; assistant_controller_observer_{this};
DISALLOW_COPY_AND_ASSIGN(AmbientAssistantDialogPlate);
}; };
} // namespace ash } // namespace ash
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "chromeos/services/assistant/public/cpp/features.h" #include "chromeos/services/assistant/public/cpp/features.h"
#include "ui/aura/window.h" #include "ui/aura/window.h"
#include "ui/views/background.h" #include "ui/views/background.h"
#include "ui/views/metadata/metadata_impl_macros.h"
#include "ui/views/view.h" #include "ui/views/view.h"
#include "ui/views/widget/widget.h" #include "ui/views/widget/widget.h"
...@@ -39,10 +40,6 @@ AmbientContainerView::AmbientContainerView(AmbientViewDelegate* delegate) ...@@ -39,10 +40,6 @@ AmbientContainerView::AmbientContainerView(AmbientViewDelegate* delegate)
AmbientContainerView::~AmbientContainerView() = default; AmbientContainerView::~AmbientContainerView() = default;
const char* AmbientContainerView::GetClassName() const {
return "AmbientContainerView";
}
gfx::Size AmbientContainerView::CalculatePreferredSize() const { gfx::Size AmbientContainerView::CalculatePreferredSize() const {
// TODO(b/139953389): Handle multiple displays. // TODO(b/139953389): Handle multiple displays.
return GetWidget()->GetNativeWindow()->GetRootWindow()->bounds().size(); return GetWidget()->GetNativeWindow()->GetRootWindow()->bounds().size();
...@@ -87,4 +84,7 @@ void AmbientContainerView::LayoutAssistantView() { ...@@ -87,4 +84,7 @@ void AmbientContainerView::LayoutAssistantView() {
gfx::Rect(0, 0, preferred_width, preferred_height)); gfx::Rect(0, 0, preferred_width, preferred_height));
} }
BEGIN_METADATA(AmbientContainerView, views::View)
END_METADATA
} // namespace ash } // namespace ash
...@@ -21,11 +21,11 @@ class PhotoView; ...@@ -21,11 +21,11 @@ class PhotoView;
// weather info. // weather info.
class ASH_EXPORT AmbientContainerView : public views::View { class ASH_EXPORT AmbientContainerView : public views::View {
public: public:
METADATA_HEADER(AmbientContainerView);
explicit AmbientContainerView(AmbientViewDelegate* delegate); explicit AmbientContainerView(AmbientViewDelegate* delegate);
~AmbientContainerView() override; ~AmbientContainerView() override;
// views::View:
const char* GetClassName() const override;
gfx::Size CalculatePreferredSize() const override; gfx::Size CalculatePreferredSize() const override;
void Layout() override; void Layout() override;
...@@ -46,7 +46,6 @@ class ASH_EXPORT AmbientContainerView : public views::View { ...@@ -46,7 +46,6 @@ class ASH_EXPORT AmbientContainerView : public views::View {
PhotoView* photo_view_ = nullptr; PhotoView* photo_view_ = nullptr;
AmbientAssistantContainerView* ambient_assistant_container_view_ = nullptr; AmbientAssistantContainerView* ambient_assistant_container_view_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(AmbientContainerView);
}; };
} // 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