#include "ui/views/layout/layout_manager_base.h"
#include <utility>
#include "base/auto_reset.h"
#include "base/check_op.h"
#include "base/containers/contains.h"
#include "base/dcheck_is_on.h"
#include "base/memory/raw_ptr.h"
#include "base/not_fatal_until.h"
#include "base/trace_event/trace_event.h"
#include "ui/views/view.h"
#include "ui/views/view_class_properties.h"
#if DCHECK_IS_ON()
#include "base/ranges/algorithm.h"
#endif
namespace views {
namespace {
SizeBounds AdjustAvailableSizeForParentAvailableSize(
const View* host,
const SizeBounds& child_available_size) { … }
bool IncludeInLayout(const View* view) { … }
}
LayoutManagerBase::~LayoutManagerBase() = default;
gfx::Size LayoutManagerBase::GetPreferredSize(const View* host) const { … }
gfx::Size LayoutManagerBase::GetPreferredSize(
const View* host,
const SizeBounds& available_size) const { … }
gfx::Size LayoutManagerBase::GetMinimumSize(const View* host) const { … }
int LayoutManagerBase::GetPreferredHeightForWidth(const View* host,
int width) const { … }
SizeBounds LayoutManagerBase::GetAvailableSize(const View* host,
const View* view) const { … }
void LayoutManagerBase::Layout(View* host) { … }
void LayoutManagerBase::OnViewPropertyChanged(View* observed_view,
const void* key,
int64_t old_value) { … }
std::vector<raw_ptr<View, VectorExperimental>>
LayoutManagerBase::GetChildViewsInPaintOrder(const View* host) const { … }
ProposedLayout LayoutManagerBase::GetProposedLayout(
const gfx::Size& host_size) const { … }
ProposedLayout LayoutManagerBase::GetProposedLayout(
const SizeBounds& size_bounds,
PassKeyType) const { … }
LayoutManagerBase::LayoutManagerBase() = default;
SizeBounds LayoutManagerBase::GetAvailableHostSize() const { … }
bool LayoutManagerBase::IsChildIncludedInLayout(const View* child,
bool include_hidden) const { … }
bool LayoutManagerBase::CanBeVisible(const View* child) const { … }
void LayoutManagerBase::LayoutImpl() { … }
void LayoutManagerBase::ApplyLayout(const ProposedLayout& layout) { … }
void LayoutManagerBase::InvalidateHost(bool mark_layouts_changed) { … }
bool LayoutManagerBase::OnChildViewIncludedInLayoutSet(View* child_view,
bool ignored) { … }
bool LayoutManagerBase::OnViewAdded(View* host, View* view) { … }
bool LayoutManagerBase::OnViewRemoved(View* host, View* view) { … }
bool LayoutManagerBase::OnViewVisibilitySet(View* host,
View* view,
bool visible) { … }
void LayoutManagerBase::OnInstalled(View* host) { … }
void LayoutManagerBase::OnLayoutChanged() { … }
void LayoutManagerBase::InvalidateLayout() { … }
void LayoutManagerBase::Installed(View* host_view) { … }
void LayoutManagerBase::ViewAdded(View* host, View* view) { … }
void LayoutManagerBase::ViewRemoved(View* host, View* view) { … }
void LayoutManagerBase::ViewVisibilitySet(View* host,
View* view,
bool old_visibility,
bool new_visibility) { … }
void LayoutManagerBase::AddOwnedLayoutInternal(
std::unique_ptr<LayoutManagerBase> owned_layout) { … }
LayoutManagerBase* LayoutManagerBase::GetRootLayoutManager() { … }
bool LayoutManagerBase::PropagateChildViewIncludedInLayout(View* child_view,
bool include) { … }
bool LayoutManagerBase::PropagateViewAdded(View* host, View* view) { … }
bool LayoutManagerBase::PropagateViewRemoved(View* host, View* view) { … }
bool LayoutManagerBase::PropagateViewVisibilitySet(View* host,
View* view,
bool visible) { … }
void LayoutManagerBase::PropagateInstalled(View* host) { … }
void LayoutManagerBase::PropagateInvalidateLayout() { … }
ManualLayoutUtil::ManualLayoutUtil(LayoutManagerBase* layout_manager)
: … { … }
ManualLayoutUtil::~ManualLayoutUtil() = default;
void ManualLayoutUtil::SetViewHidden(View* child_view, bool hidden) { … }
ManualLayoutUtil::TemporaryExclusion
ManualLayoutUtil::TemporarilyExcludeFromLayout(View* child_view) { … }
void ManualLayoutUtil::TemporaryExclusionDeleter::operator()(
TemporaryExclusionData* data) const { … }
void ManualLayoutUtil::EndTemporaryExclusion(View* child_view) { … }
}