OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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. |
| 4 |
| 5 #ifndef UI_VIEWS_TEST_TEST_LAYOUT_PROVIDER_H_ |
| 6 #define UI_VIEWS_TEST_TEST_LAYOUT_PROVIDER_H_ |
| 7 |
| 8 #include <map> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "ui/views/layout/layout_provider.h" |
| 12 |
| 13 namespace views { |
| 14 namespace test { |
| 15 |
| 16 // Helper to test LayoutProvider overrides. |
| 17 class TestLayoutProvider : public LayoutProvider { |
| 18 public: |
| 19 TestLayoutProvider(); |
| 20 ~TestLayoutProvider() override; |
| 21 |
| 22 // Override requests for the |metric| DistanceMetric to return |value| rather |
| 23 // than the default. |
| 24 void SetDistanceMetric(int metric, int value); |
| 25 |
| 26 // Override the return value of GetSnappedDialogWidth(). |
| 27 void SetSnappedDialogWidth(int width); |
| 28 |
| 29 // LayoutProvider: |
| 30 int GetDistanceMetric(int metric) const override; |
| 31 int GetSnappedDialogWidth(int min_width) const override; |
| 32 |
| 33 private: |
| 34 std::map<int, int> distance_metrics_; |
| 35 int snapped_dialog_width_ = 0; |
| 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(TestLayoutProvider); |
| 38 }; |
| 39 |
| 40 } // namespace test |
| 41 } // namespace views |
| 42 |
| 43 #endif // UI_VIEWS_TEST_TEST_LAYOUT_PROVIDER_H_ |
OLD | NEW |