| 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 #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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |