#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 = …;
}
const int OpaqueBrowserFrameViewLayout::kContentEdgeShadowThickness = …;
const int OpaqueBrowserFrameViewLayout::kTopFrameEdgeThickness = …;
const int OpaqueBrowserFrameViewLayout::kSideFrameEdgeThickness = …;
const int OpaqueBrowserFrameViewLayout::kIconLeftSpacing = …;
const int OpaqueBrowserFrameViewLayout::kIconTitleSpacing = …;
const int OpaqueBrowserFrameViewLayout::kCaptionSpacing = …;
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::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 { … }
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) { … }
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) { … }