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

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

Issue 2538513002: [ash-md] Fixed TriView to relayout child Views when their preferred size changed. (Closed)
Patch Set: Created 4 years 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
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 <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 28 matching lines...) Expand all
39 39
40 DISALLOW_COPY_AND_ASSIGN(StaticSizedView); 40 DISALLOW_COPY_AND_ASSIGN(StaticSizedView);
41 }; 41 };
42 42
43 // A view that accomodates testing layouts that use GetHeightForWidth. 43 // A view that accomodates testing layouts that use GetHeightForWidth.
44 class ProportionallySizedView : public View { 44 class ProportionallySizedView : public View {
45 public: 45 public:
46 explicit ProportionallySizedView(int factor); 46 explicit ProportionallySizedView(int factor);
47 ~ProportionallySizedView() override; 47 ~ProportionallySizedView() override;
48 48
49 void set_preferred_width(int width) { preferred_width_ = width; } 49 void SetPreferredWidth(int width);
50 50
51 int GetHeightForWidth(int w) const override; 51 int GetHeightForWidth(int w) const override;
52 gfx::Size GetPreferredSize() const override; 52 gfx::Size GetPreferredSize() const override;
53 53
54 private: 54 private:
55 // The multiplicative factor between width and height, i.e. 55 // The multiplicative factor between width and height, i.e.
56 // height = width * factor_. 56 // height = width * factor_.
57 int factor_; 57 int factor_;
58 58
59 // The width used as the preferred size. -1 if not used. 59 // The width used as the preferred size. -1 if not used.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 std::map<ui::EventType, int> event_count_; 111 std::map<ui::EventType, int> event_count_;
112 int last_flags_; 112 int last_flags_;
113 HandleMode handle_mode_; 113 HandleMode handle_mode_;
114 114
115 DISALLOW_COPY_AND_ASSIGN(EventCountView); 115 DISALLOW_COPY_AND_ASSIGN(EventCountView);
116 }; 116 };
117 117
118 } // namespace views 118 } // namespace views
119 119
120 #endif // UI_VIEWS_TEST_TEST_VIEWS_H_ 120 #endif // UI_VIEWS_TEST_TEST_VIEWS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698