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 #include "ui/views/test/test_layout_provider.h" |
| 6 |
| 7 namespace views { |
| 8 namespace test { |
| 9 |
| 10 TestLayoutProvider::TestLayoutProvider() {} |
| 11 TestLayoutProvider::~TestLayoutProvider() {} |
| 12 |
| 13 void TestLayoutProvider::SetDistanceMetric(int metric, int value) { |
| 14 distance_metrics_[metric] = value; |
| 15 } |
| 16 void TestLayoutProvider::SetSnappedDialogWidth(int width) { |
| 17 snapped_dialog_width_ = width; |
| 18 } |
| 19 |
| 20 int TestLayoutProvider::GetDistanceMetric(int metric) const { |
| 21 if (distance_metrics_.count(metric)) |
| 22 return distance_metrics_.find(metric)->second; |
| 23 return LayoutProvider::GetDistanceMetric(metric); |
| 24 } |
| 25 |
| 26 int TestLayoutProvider::GetSnappedDialogWidth(int min_width) const { |
| 27 return snapped_dialog_width_ ? snapped_dialog_width_ : min_width; |
| 28 } |
| 29 |
| 30 } // namespace test |
| 31 } // namespace views |
OLD | NEW |