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

Side by Side Diff: ui/views/test/test_layout_provider.cc

Issue 2860953002: Harmony: Apply the upper bound on equal-sized button widths in DialogClientView. (Closed)
Patch Set: test_layout_provider.h, sanity checks, self-review: nit data member names Created 3 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
« no previous file with comments | « ui/views/test/test_layout_provider.h ('k') | ui/views/window/dialog_client_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « ui/views/test/test_layout_provider.h ('k') | ui/views/window/dialog_client_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698