chromium/chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.cc

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

#include "chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.h"

#include <algorithm>
#include <string>
#include <vector>

#include "base/command_line.h"
#include "base/containers/adapters.h"
#include "base/i18n/rtl.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/views/frame/caption_button_placeholder_container.h"
#include "ui/base/ui_base_features.h"
#include "ui/compositor/layer.h"
#include "ui/gfx/font.h"
#include "ui/views/controls/button/image_button.h"
#include "ui/views/controls/label.h"
#include "ui/views/view_utils.h"
#include "ui/views/window/caption_button_layout_constants.h"
#include "ui/views/window/frame_caption_button.h"

namespace {

constexpr int kCaptionButtonHeight =;

}  // namespace

///////////////////////////////////////////////////////////////////////////////
// OpaqueBrowserFrameViewLayout, public:

// statics

// The content edge images have a shadow built into them.
const int OpaqueBrowserFrameViewLayout::kContentEdgeShadowThickness =;

// The frame has a 2 px 3D edge along the top.  This is overridable by
// subclasses, so RestoredFrameEdgeInsets() should be used instead of using this
// constant directly.
const int OpaqueBrowserFrameViewLayout::kTopFrameEdgeThickness =;

// The frame has a 1 px 3D edge along the side.  This is overridable by
// subclasses, so RestoredFrameEdgeInsets() should be used instead of using this
// constant directly.
const int OpaqueBrowserFrameViewLayout::kSideFrameEdgeThickness =;

// The icon is inset 1 px from the left frame border.
const int OpaqueBrowserFrameViewLayout::kIconLeftSpacing =;

// There is a 4 px gap between the icon and the title text.
const int OpaqueBrowserFrameViewLayout::kIconTitleSpacing =;

// The horizontal spacing to use in most cases when laying out things near the
// caption button area.
const int OpaqueBrowserFrameViewLayout::kCaptionSpacing =;

// The minimum vertical padding between the bottom of the caption buttons and
// the top of the content shadow.
const int OpaqueBrowserFrameViewLayout::kCaptionButtonBottomPadding =;

OpaqueBrowserFrameViewLayout::OpaqueBrowserFrameViewLayout() = default;

OpaqueBrowserFrameViewLayout::~OpaqueBrowserFrameViewLayout() = default;

void OpaqueBrowserFrameViewLayout::SetButtonOrdering(
    const std::vector<views::FrameButton>& leading_buttons,
    const std::vector<views::FrameButton>& trailing_buttons) {}

gfx::Rect OpaqueBrowserFrameViewLayout::GetBoundsForTabStripRegion(
    const gfx::Size& tabstrip_minimum_size,
    int total_width) const {}

gfx::Rect OpaqueBrowserFrameViewLayout::GetBoundsForWebAppFrameToolbar(
    const gfx::Size& toolbar_preferred_size) const {}

void OpaqueBrowserFrameViewLayout::LayoutWebAppWindowTitle(
    const gfx::Rect& available_space,
    views::Label& window_title_label) const {}

gfx::Size OpaqueBrowserFrameViewLayout::GetMinimumSize(
    const views::View* host) const {}

gfx::Rect OpaqueBrowserFrameViewLayout::GetWindowBoundsForClientBounds(
    const gfx::Rect& client_bounds) const {}

gfx::Insets OpaqueBrowserFrameViewLayout::FrameBorderInsets(
    bool restored) const {}

int OpaqueBrowserFrameViewLayout::FrameTopBorderThickness(bool restored) const {}

int OpaqueBrowserFrameViewLayout::NonClientTopHeight(bool restored) const {}

gfx::Insets OpaqueBrowserFrameViewLayout::FrameEdgeInsets(bool restored) const {}

int OpaqueBrowserFrameViewLayout::DefaultCaptionButtonY(bool restored) const {}

int OpaqueBrowserFrameViewLayout::CaptionButtonY(views::FrameButton button_id,
                                                 bool restored) const {}

gfx::Rect OpaqueBrowserFrameViewLayout::IconBounds() const {}

gfx::Rect OpaqueBrowserFrameViewLayout::CalculateClientAreaBounds(
    int width,
    int height) const {}

int OpaqueBrowserFrameViewLayout::GetWindowCaptionSpacing(
    views::FrameButton button_id,
    bool leading_spacing,
    bool is_leading_button) const {}

void OpaqueBrowserFrameViewLayout::SetWindowControlsOverlayEnabled(
    bool enabled,
    views::View* host) {}

void OpaqueBrowserFrameViewLayout::SetBorderlessModeEnabled(bool enabled,
                                                            views::View* host) {}

///////////////////////////////////////////////////////////////////////////////
// OpaqueBrowserFrameViewLayout, protected:

OpaqueBrowserFrameViewLayout::TopAreaPadding
OpaqueBrowserFrameViewLayout::GetTopAreaPadding(
    bool has_leading_buttons,
    bool has_trailing_buttons) const {}

gfx::Insets OpaqueBrowserFrameViewLayout::RestoredFrameBorderInsets() const {}

gfx::Insets OpaqueBrowserFrameViewLayout::RestoredFrameEdgeInsets() const {}

int OpaqueBrowserFrameViewLayout::NonClientExtraTopThickness() const {}

bool OpaqueBrowserFrameViewLayout::IsFrameEdgeVisible(bool restored) const {}

///////////////////////////////////////////////////////////////////////////////
// OpaqueBrowserFrameViewLayout, private:

void OpaqueBrowserFrameViewLayout::LayoutWindowControls() {}

void OpaqueBrowserFrameViewLayout::LayoutTitleBar() {}

void OpaqueBrowserFrameViewLayout::ConfigureButton(views::FrameButton button_id,
                                                   ButtonAlignment alignment) {}

void OpaqueBrowserFrameViewLayout::HideButton(views::FrameButton button_id) {}

void OpaqueBrowserFrameViewLayout::SetBoundsForButton(
    views::FrameButton button_id,
    views::Button* button,
    ButtonAlignment alignment) {}

void OpaqueBrowserFrameViewLayout::SetView(int id, views::View* view) {}

OpaqueBrowserFrameViewLayout::TopAreaPadding
OpaqueBrowserFrameViewLayout::GetTopAreaPadding() const {}

void OpaqueBrowserFrameViewLayout::LayoutTitleBarForWindowControlsOverlay(
    const views::View* host) {}

///////////////////////////////////////////////////////////////////////////////
// OpaqueBrowserFrameViewLayout, views::LayoutManager:

void OpaqueBrowserFrameViewLayout::Layout(views::View* host) {}

gfx::Size OpaqueBrowserFrameViewLayout::GetPreferredSize(
    const views::View* host) const {}

gfx::Size OpaqueBrowserFrameViewLayout::GetPreferredSize(
    const views::View* host,
    const views::SizeBounds& available_size) const {}

void OpaqueBrowserFrameViewLayout::ViewAdded(views::View* host,
                                             views::View* view) {}

void OpaqueBrowserFrameViewLayout::ViewRemoved(views::View* host,
                                               views::View* view) {}