Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(458)

Side by Side Diff: ui/views/test/test_views.h

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More compile fix for ToT Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/test/child_modal_window.cc ('k') | ui/views/test/test_views.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef UI_VIEWS_TEST_TEST_VIEWS_H_ 5 #ifndef UI_VIEWS_TEST_TEST_VIEWS_H_
6 #define UI_VIEWS_TEST_TEST_VIEWS_H_ 6 #define UI_VIEWS_TEST_TEST_VIEWS_H_
7 7
8 #include "ui/views/view.h" 8 #include "ui/views/view.h"
9 9
10 namespace views { 10 namespace views {
11 11
12 // A view that requests a set amount of space. 12 // A view that requests a set amount of space.
13 class StaticSizedView : public View { 13 class StaticSizedView : public View {
14 public: 14 public:
15 explicit StaticSizedView(const gfx::Size& size); 15 explicit StaticSizedView(const gfx::Size& size);
16 virtual ~StaticSizedView(); 16 virtual ~StaticSizedView();
17 17
18 virtual gfx::Size GetPreferredSize() OVERRIDE; 18 virtual gfx::Size GetPreferredSize() const OVERRIDE;
19 19
20 private: 20 private:
21 gfx::Size size_; 21 gfx::Size size_;
22 22
23 DISALLOW_COPY_AND_ASSIGN(StaticSizedView); 23 DISALLOW_COPY_AND_ASSIGN(StaticSizedView);
24 }; 24 };
25 25
26 // A view that accomodates testing layouts that use GetHeightForWidth. 26 // A view that accomodates testing layouts that use GetHeightForWidth.
27 class ProportionallySizedView : public View { 27 class ProportionallySizedView : public View {
28 public: 28 public:
29 explicit ProportionallySizedView(int factor); 29 explicit ProportionallySizedView(int factor);
30 virtual ~ProportionallySizedView(); 30 virtual ~ProportionallySizedView();
31 31
32 virtual int GetHeightForWidth(int w) OVERRIDE; 32 virtual int GetHeightForWidth(int w) const OVERRIDE;
33 33
34 private: 34 private:
35 // The multiplicative factor between width and height, i.e. 35 // The multiplicative factor between width and height, i.e.
36 // height = width * factor_. 36 // height = width * factor_.
37 int factor_; 37 int factor_;
38 38
39 DISALLOW_COPY_AND_ASSIGN(ProportionallySizedView); 39 DISALLOW_COPY_AND_ASSIGN(ProportionallySizedView);
40 }; 40 };
41 41
42 } // namespace views 42 } // namespace views
43 43
44 #endif // UI_VIEWS_TEST_TEST_VIEWS_H_ 44 #endif // UI_VIEWS_TEST_TEST_VIEWS_H_
OLDNEW
« no previous file with comments | « ui/views/test/child_modal_window.cc ('k') | ui/views/test/test_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698