Commit f1ec5291 authored by Peter Kasting's avatar Peter Kasting Committed by Commit Bot

Followon changes after r809245.

This implements a variety of nits from the review, brings the
implementations of the shortage and excess passes closer together, and
removes the flex_layout-specific OWNERS since this is now owned by the
main Views team in the same way as the rest of the directory.

Bug: none
Change-Id: I0d37f261e4d8ad7211919bc9df7bbc5b09e4489a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2427532
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Allen Bauer <kylixrd@chromium.org>
Reviewed-by: default avatarAllen Bauer <kylixrd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810403}
parent b16f8022
This diff is collapsed.
...@@ -212,7 +212,7 @@ class VIEWS_EXPORT FlexLayout : public LayoutManagerBase { ...@@ -212,7 +212,7 @@ class VIEWS_EXPORT FlexLayout : public LayoutManagerBase {
// Calculates available space along the main axis for non-flex views and // Calculates available space along the main axis for non-flex views and
// the values in |data.child_data|. // the values in |data.child_data|.
void CalculateNonFlexAvailableSpace(int available_space, void CalculateNonFlexAvailableSpace(const SizeBound& available_space,
const FlexOrderToViewIndexMap& flex_views, const FlexOrderToViewIndexMap& flex_views,
const ChildViewSpacing& child_spacing, const ChildViewSpacing& child_spacing,
FlexLayoutData& data) const; FlexLayoutData& data) const;
...@@ -258,16 +258,15 @@ class VIEWS_EXPORT FlexLayout : public LayoutManagerBase { ...@@ -258,16 +258,15 @@ class VIEWS_EXPORT FlexLayout : public LayoutManagerBase {
FlexOrderToViewIndexMap* expandable_views) const; FlexOrderToViewIndexMap* expandable_views) const;
// Tries to allocate all the views in |child_list| in the available |bounds|. // Tries to allocate all the views in |child_list| in the available |bounds|.
// If successful, returns true and updates |data| and |expandable_views|. // If successful, updates |data| and |expandable_views|. Returns the
// |remaining_deficit| is set to the difference between the space needed by // difference between the space needed by all of the views in |child_list| and
// all of the views in |child_list| and the space provided by |bounds|. // the space provided by |bounds|.
bool TryAllocateAll(const NormalizedSizeBounds& bounds, SizeBound TryAllocateAll(const NormalizedSizeBounds& bounds,
int flex_order, int flex_order,
const ChildIndices& child_list, const ChildIndices& child_list,
FlexLayoutData& data, FlexLayoutData& data,
ChildViewSpacing& child_spacing, ChildViewSpacing& child_spacing,
FlexOrderToViewIndexMap& expandable_views, FlexOrderToViewIndexMap& expandable_views) const;
int& remaining_deficit) const;
// Allocates flex excess |to_allocate| for a list of child views at the same // Allocates flex excess |to_allocate| for a list of child views at the same
// priority order. // priority order.
...@@ -281,7 +280,7 @@ class VIEWS_EXPORT FlexLayout : public LayoutManagerBase { ...@@ -281,7 +280,7 @@ class VIEWS_EXPORT FlexLayout : public LayoutManagerBase {
// //
// This method should be called repeatedly until |child_list| is empty. // This method should be called repeatedly until |child_list| is empty.
void AllocateFlexExcessAtOrder(const NormalizedSizeBounds& bounds, void AllocateFlexExcessAtOrder(const NormalizedSizeBounds& bounds,
int& to_allocate, SizeBound& to_allocate,
ChildIndices& child_list, ChildIndices& child_list,
FlexLayoutData& data, FlexLayoutData& data,
ChildViewSpacing& child_spacing) const; ChildViewSpacing& child_spacing) const;
...@@ -297,7 +296,7 @@ class VIEWS_EXPORT FlexLayout : public LayoutManagerBase { ...@@ -297,7 +296,7 @@ class VIEWS_EXPORT FlexLayout : public LayoutManagerBase {
// //
// This method should be called repeatedly until |child_list| is empty. // This method should be called repeatedly until |child_list| is empty.
void AllocateFlexShortageAtOrder(const NormalizedSizeBounds& bounds, void AllocateFlexShortageAtOrder(const NormalizedSizeBounds& bounds,
int deficit, SizeBound deficit,
ChildIndices& child_list, ChildIndices& child_list,
FlexLayoutData& data, FlexLayoutData& data,
ChildViewSpacing& child_spacing) const; ChildViewSpacing& child_spacing) const;
......
...@@ -2786,7 +2786,7 @@ Size StepwiseFlexRule(int step, ...@@ -2786,7 +2786,7 @@ Size StepwiseFlexRule(int step,
return preferred; return preferred;
} }
} // anonymous namespace } // namespace
// When a view does not take all of the space granted it when excess space is // When a view does not take all of the space granted it when excess space is
// being distributed (views flexing above their preferred size) the remaining // being distributed (views flexing above their preferred size) the remaining
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment