chromium/ui/views/window/custom_frame_view.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {

// The frame border is only visible in restored mode and is hardcoded to 4 px on
// each side regardless of the system window border size.
constexpr int kFrameBorderThickness =;
// In the window corners, the resize areas don't actually expand bigger, but the
// 16 px at the end of each edge triggers diagonal resizing.
constexpr int kResizeAreaCornerSize =;
// The titlebar never shrinks too short to show the caption button plus some
// padding below it.
constexpr int kCaptionButtonHeightWithPadding =;
// The titlebar has a 2 px 3D edge along the top and bottom.
constexpr int kTitlebarTopAndBottomEdgeThickness =;
// The icon is inset 2 px from the left frame border.
constexpr int kIconLeftSpacing =;
// The space between the window icon and the title text.
constexpr int kTitleIconOffsetX =;
// The space between the title text and the caption buttons.
constexpr int kTitleCaptionSpacing =;

void LayoutButton(ImageButton* button, const gfx::Rect& bounds) {}

}  // namespace

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) {}

// static
gfx::FontList CustomFrameView::GetWindowTitleFontList() {}

}  // namespace views