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

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

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/layout/layout_provider.cc ('k') | ui/views/test/test_layout_provider.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 #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_
OLDNEW
« no previous file with comments | « ui/views/layout/layout_provider.cc ('k') | ui/views/test/test_layout_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698