#include "ui/views/window/custom_frame_view.h"
#include <algorithm>
#include <utility>
#include <vector>
#include "base/containers/adapters.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "third_party/skia/include/core/SkPath.h"
#include "ui/base/hit_test.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/models/image_model.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/color/color_id.h"
#include "ui/color/color_provider.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/font.h"
#include "ui/gfx/font_list.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/image/image.h"
#include "ui/strings/grit/ui_strings.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/controls/button/image_button.h"
#include "ui/views/resources/grit/views_resources.h"
#include "ui/views/views_delegate.h"
#include "ui/views/widget/native_widget_private.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
#include "ui/views/window/client_view.h"
#include "ui/views/window/frame_background.h"
#include "ui/views/window/window_button_order_provider.h"
#include "ui/views/window/window_resources.h"
#include "ui/views/window/window_shape.h"
#if BUILDFLAG(IS_WIN)
#include "ui/display/win/screen_win.h"
#include "ui/gfx/system_fonts_win.h"
#endif
namespace views {
namespace {
constexpr int kFrameBorderThickness = …;
constexpr int kResizeAreaCornerSize = …;
constexpr int kCaptionButtonHeightWithPadding = …;
constexpr int kTitlebarTopAndBottomEdgeThickness = …;
constexpr int kIconLeftSpacing = …;
constexpr int kTitleIconOffsetX = …;
constexpr int kTitleCaptionSpacing = …;
void LayoutButton(ImageButton* button, const gfx::Rect& bounds) { … }
}
CustomFrameView::CustomFrameView(Widget* frame)
: … { … }
CustomFrameView::~CustomFrameView() = default;
gfx::Rect CustomFrameView::GetBoundsForClientView() const { … }
gfx::Rect CustomFrameView::GetWindowBoundsForClientBounds(
const gfx::Rect& client_bounds) const { … }
int CustomFrameView::NonClientHitTest(const gfx::Point& point) { … }
void CustomFrameView::GetWindowMask(const gfx::Size& size,
SkPath* window_mask) { … }
void CustomFrameView::ResetWindowControls() { … }
void CustomFrameView::UpdateWindowIcon() { … }
void CustomFrameView::UpdateWindowTitle() { … }
void CustomFrameView::SizeConstraintsChanged() { … }
void CustomFrameView::OnPaint(gfx::Canvas* canvas) { … }
void CustomFrameView::Layout(PassKey) { … }
gfx::Size CustomFrameView::CalculatePreferredSize(
const SizeBounds& available_size) const { … }
gfx::Size CustomFrameView::GetMinimumSize() const { … }
gfx::Size CustomFrameView::GetMaximumSize() const { … }
int CustomFrameView::FrameBorderThickness() const { … }
int CustomFrameView::NonClientBorderThickness() const { … }
int CustomFrameView::NonClientTopBorderHeight() const { … }
int CustomFrameView::CaptionButtonY() const { … }
int CustomFrameView::TitlebarBottomThickness() const { … }
int CustomFrameView::IconSize() const { … }
gfx::Rect CustomFrameView::IconBounds() const { … }
bool CustomFrameView::ShouldShowTitleBarAndBorder() const { … }
bool CustomFrameView::ShouldShowClientEdge() const { … }
void CustomFrameView::PaintRestoredFrameBorder(gfx::Canvas* canvas) { … }
void CustomFrameView::PaintMaximizedFrameBorder(gfx::Canvas* canvas) { … }
void CustomFrameView::PaintTitleBar(gfx::Canvas* canvas) { … }
void CustomFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) { … }
SkColor CustomFrameView::GetFrameColor() const { … }
gfx::ImageSkia CustomFrameView::GetFrameImage() const { … }
void CustomFrameView::LayoutWindowControls() { … }
void CustomFrameView::LayoutTitleBar() { … }
void CustomFrameView::LayoutClientView() { … }
ImageButton* CustomFrameView::InitWindowCaptionButton(
Button::PressedCallback callback,
int accessibility_string_id,
int normal_image_id,
int hot_image_id,
int pushed_image_id) { … }
ImageButton* CustomFrameView::GetImageButton(views::FrameButton frame_button) { … }
gfx::FontList CustomFrameView::GetWindowTitleFontList() { … }
}