0

Adding metadata to AppWindowFrameView

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: I706f2112b27aceedc94beb081339ed60c11f8c75
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2599689
Reviewed-by: Allen Bauer <kylixrd@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Commit-Queue: Shengsong Tan <sstan@google.com>
Cr-Commit-Position: refs/heads/master@{#840516}
This commit is contained in:
Shengsong Tan
2021-01-06 07:36:40 +00:00
committed by Chromium LUCI CQ
parent 0ca45619f3
commit a487181ca0
2 changed files with 6 additions and 7 deletions

@ -24,6 +24,7 @@
#include "ui/strings/grit/ui_strings.h" // Accessibility names
#include "ui/views/controls/button/image_button.h"
#include "ui/views/layout/grid_layout.h"
#include "ui/views/metadata/metadata_impl_macros.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
@ -35,9 +36,6 @@ const int kCaptionHeight = 25;
namespace apps {
const char AppWindowFrameView::kViewClassName[] =
"browser/ui/views/extensions/AppWindowFrameView";
AppWindowFrameView::AppWindowFrameView(views::Widget* widget,
extensions::NativeAppWindow* window,
bool draw_frame,
@ -325,8 +323,6 @@ void AppWindowFrameView::OnPaint(gfx::Canvas* canvas) {
canvas->DrawPath(path, flags);
}
const char* AppWindowFrameView::GetClassName() const { return kViewClassName; }
gfx::Size AppWindowFrameView::GetMinimumSize() const {
gfx::Size min_size = widget_->client_view()->GetMinimumSize();
if (!draw_frame_) {
@ -392,4 +388,7 @@ void AppWindowFrameView::SetButtonImagesForFrame() {
}
}
BEGIN_METADATA(AppWindowFrameView, views::NonClientFrameView)
END_METADATA
} // namespace apps

@ -11,6 +11,7 @@
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/metadata/metadata_header_macros.h"
#include "ui/views/window/non_client_view.h"
namespace extensions {
@ -32,7 +33,7 @@ namespace apps {
// A frameless or non-Ash, non-panel NonClientFrameView for app windows.
class AppWindowFrameView : public views::NonClientFrameView {
public:
static const char kViewClassName[];
METADATA_HEADER(AppWindowFrameView);
// AppWindowFrameView is used to draw frames for app windows when a non
// standard frame is needed. This occurs if there is no frame needed, or if
@ -73,7 +74,6 @@ class AppWindowFrameView : public views::NonClientFrameView {
// views::View implementation.
gfx::Size CalculatePreferredSize() const override;
void Layout() override;
const char* GetClassName() const override;
void OnPaint(gfx::Canvas* canvas) override;
gfx::Size GetMinimumSize() const override;
gfx::Size GetMaximumSize() const override;