Workaround for xkbcommon dead keys.
[chromium-blink-merge.git] / ui / views / test / test_views.cc
blob320ec8e0f8e3cc1dcbd4da0283e5ef033c085300
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 #include "ui/views/test/test_views.h"
7 namespace views {
9 StaticSizedView::StaticSizedView(const gfx::Size& size) : size_(size) {}
11 StaticSizedView::~StaticSizedView() {}
13 gfx::Size StaticSizedView::GetPreferredSize() const {
14 return size_;
17 ProportionallySizedView::ProportionallySizedView(int factor)
18 : factor_(factor), preferred_width_(-1) {}
20 ProportionallySizedView::~ProportionallySizedView() {}
22 int ProportionallySizedView::GetHeightForWidth(int w) const {
23 return w * factor_;
26 gfx::Size ProportionallySizedView::GetPreferredSize() const {
27 if (preferred_width_ >= 0)
28 return gfx::Size(preferred_width_, GetHeightForWidth(preferred_width_));
29 return View::GetPreferredSize();
32 } // namespace views