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

Adding metadata to NonClientFrameViewAsh

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: I8bbb27d84ecfbcfa86e9fb637de69355ee9868a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2601021Reviewed-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@{#844431}
parent 03b00b94
......@@ -32,6 +32,7 @@
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/views/metadata/metadata_impl_macros.h"
#include "ui/views/view.h"
#include "ui/views/view_targeter.h"
#include "ui/views/widget/widget.h"
......@@ -71,6 +72,10 @@ class NonClientFrameViewAshImmersiveHelper : public WindowStateObserver,
custom_frame_view->InitImmersiveFullscreenControllerForView(
immersive_fullscreen_controller_.get());
}
NonClientFrameViewAshImmersiveHelper(
const NonClientFrameViewAshImmersiveHelper&) = delete;
NonClientFrameViewAshImmersiveHelper& operator=(
const NonClientFrameViewAshImmersiveHelper&) = delete;
~NonClientFrameViewAshImmersiveHelper() override {
if (Shell::Get()->tablet_mode_controller())
......@@ -143,8 +148,6 @@ class NonClientFrameViewAshImmersiveHelper : public WindowStateObserver,
WindowState* window_state_;
std::unique_ptr<ImmersiveFullscreenController>
immersive_fullscreen_controller_;
DISALLOW_COPY_AND_ASSIGN(NonClientFrameViewAshImmersiveHelper);
};
// View which takes up the entire widget and contains the HeaderView. HeaderView
......@@ -154,6 +157,8 @@ class NonClientFrameViewAsh::OverlayView : public views::View,
public views::ViewTargeterDelegate {
public:
explicit OverlayView(HeaderView* header_view);
OverlayView(const OverlayView&) = delete;
OverlayView& operator=(const OverlayView&) = delete;
~OverlayView() override;
// views::View:
......@@ -166,8 +171,6 @@ class NonClientFrameViewAsh::OverlayView : public views::View,
const gfx::Rect& rect) const override;
HeaderView* header_view_;
DISALLOW_COPY_AND_ASSIGN(OverlayView);
};
NonClientFrameViewAsh::OverlayView::OverlayView(HeaderView* header_view)
......@@ -205,9 +208,6 @@ bool NonClientFrameViewAsh::OverlayView::DoesIntersectRect(
return header_view_->HitTestRect(rect);
}
// static
const char NonClientFrameViewAsh::kViewClassName[] = "NonClientFrameViewAsh";
NonClientFrameViewAsh::NonClientFrameViewAsh(views::Widget* frame)
: frame_(frame),
header_view_(new HeaderView(frame, this)),
......@@ -331,10 +331,6 @@ void NonClientFrameViewAsh::Layout() {
NonClientTopBorderHeight());
}
const char* NonClientFrameViewAsh::GetClassName() const {
return kViewClassName;
}
gfx::Size NonClientFrameViewAsh::GetMinimumSize() const {
if (!GetEnabled())
return gfx::Size();
......@@ -425,4 +421,7 @@ void NonClientFrameViewAsh::PaintAsActiveChanged() {
frame_->non_client_view()->Layout();
}
BEGIN_METADATA(NonClientFrameViewAsh, views::NonClientFrameView)
END_METADATA
} // namespace ash
......@@ -14,6 +14,7 @@
#include "base/memory/weak_ptr.h"
#include "base/optional.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/views/metadata/metadata_header_macros.h"
#include "ui/views/widget/widget.h"
#include "ui/views/window/non_client_view.h"
......@@ -38,14 +39,15 @@ class NonClientFrameViewAshImmersiveHelper;
// BrowserNonClientFrameViewAsh.
class ASH_EXPORT NonClientFrameViewAsh : public views::NonClientFrameView {
public:
// Internal class name.
static const char kViewClassName[];
METADATA_HEADER(NonClientFrameViewAsh);
// |control_immersive| controls whether ImmersiveFullscreenController is
// created for the NonClientFrameViewAsh; if true and a WindowStateDelegate
// has not been set on the WindowState associated with |frame|, then an
// ImmersiveFullscreenController is created.
explicit NonClientFrameViewAsh(views::Widget* frame);
NonClientFrameViewAsh(const NonClientFrameViewAsh&) = delete;
NonClientFrameViewAsh& operator=(const NonClientFrameViewAsh&) = delete;
~NonClientFrameViewAsh() override;
static NonClientFrameViewAsh* Get(aura::Window* window);
......@@ -86,7 +88,6 @@ class ASH_EXPORT NonClientFrameViewAsh : public views::NonClientFrameView {
// views::View:
gfx::Size CalculatePreferredSize() const override;
void Layout() override;
const char* GetClassName() const override;
gfx::Size GetMinimumSize() const override;
gfx::Size GetMaximumSize() const override;
void SetVisible(bool visible) override;
......@@ -148,8 +149,6 @@ class ASH_EXPORT NonClientFrameViewAsh : public views::NonClientFrameView {
base::Unretained(this)));
base::WeakPtrFactory<NonClientFrameViewAsh> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(NonClientFrameViewAsh);
};
} // 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