Commit b9b1a120 authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Fix static initializer in ambient_background_image_view.cc.

https://crrev.com/809702 added a global constant to
ambient_background_image_view.cc, but the constant adds a static
initializer. Avoid this by making the constant local to the method it is
used in. Then it is initialized on first use instead.

Bug: 537099
Change-Id: I1724e5a563e1a30a6aa6c8b306626ec86f6a570a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2427549Reviewed-by: default avatarTao Wu <wutao@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810037}
parent 9572b02d
......@@ -44,10 +44,6 @@ int translate_y_direction = -1;
int current_x_translation = 0;
int current_y_translation = 0;
const views::FlexSpecification kUnboundedScaleToZero(
views::MinimumFlexSizeRule::kScaleToZero,
views::MaximumFlexSizeRule::kUnbounded);
gfx::ImageSkia ResizeImage(const gfx::ImageSkia& image,
const gfx::Size& view_size) {
if (image.isNull())
......@@ -165,6 +161,10 @@ void AmbientBackgroundImageView::ResetRelatedImageForTesting() {
}
void AmbientBackgroundImageView::InitLayout() {
static const views::FlexSpecification kUnboundedScaleToZero(
views::MinimumFlexSizeRule::kScaleToZero,
views::MaximumFlexSizeRule::kUnbounded);
SetLayoutManager(std::make_unique<views::FillLayout>());
// Inits container for images.
......
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