1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_VIEWS_TEST_TEST_VIEWS_H_
6 #define UI_VIEWS_TEST_TEST_VIEWS_H_
8 #include "ui/views/view.h"
12 // A view that requests a set amount of space.
13 class StaticSizedView
: public View
{
15 explicit StaticSizedView(const gfx::Size
& size
);
16 virtual ~StaticSizedView();
18 virtual gfx::Size
GetPreferredSize() const OVERRIDE
;
23 DISALLOW_COPY_AND_ASSIGN(StaticSizedView
);
26 // A view that accomodates testing layouts that use GetHeightForWidth.
27 class ProportionallySizedView
: public View
{
29 explicit ProportionallySizedView(int factor
);
30 virtual ~ProportionallySizedView();
32 virtual int GetHeightForWidth(int w
) const OVERRIDE
;
35 // The multiplicative factor between width and height, i.e.
36 // height = width * factor_.
39 DISALLOW_COPY_AND_ASSIGN(ProportionallySizedView
);
44 #endif // UI_VIEWS_TEST_TEST_VIEWS_H_