OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/test/test_views.h" | 5 #include "ui/views/test/test_views.h" |
6 | 6 |
7 namespace views { | 7 namespace views { |
8 | 8 |
9 StaticSizedView::StaticSizedView(const gfx::Size& size) : size_(size) {} | 9 StaticSizedView::StaticSizedView(const gfx::Size& size) : size_(size) {} |
10 | 10 |
11 StaticSizedView::~StaticSizedView() {} | 11 StaticSizedView::~StaticSizedView() {} |
12 | 12 |
13 gfx::Size StaticSizedView::GetPreferredSize() { | 13 gfx::Size StaticSizedView::GetPreferredSize() const { |
14 return size_; | 14 return size_; |
15 } | 15 } |
16 | 16 |
17 ProportionallySizedView::ProportionallySizedView(int factor) | 17 ProportionallySizedView::ProportionallySizedView(int factor) |
18 : factor_(factor) {} | 18 : factor_(factor) {} |
19 | 19 |
20 ProportionallySizedView::~ProportionallySizedView() {} | 20 ProportionallySizedView::~ProportionallySizedView() {} |
21 | 21 |
22 int ProportionallySizedView::GetHeightForWidth(int w) { | 22 int ProportionallySizedView::GetHeightForWidth(int w) const { |
23 return w * factor_; | 23 return w * factor_; |
24 } | 24 } |
25 | 25 |
26 } // namespace views | 26 } // namespace views |
OLD | NEW |