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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/test/test_layout_provider.h
diff --git a/ui/views/test/test_layout_provider.h b/ui/views/test/test_layout_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..ede0b65c8ee3aed9cae7564f6b4003dd40735139
--- /dev/null
+++ b/ui/views/test/test_layout_provider.h
@@ -0,0 +1,43 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_VIEWS_TEST_TEST_LAYOUT_PROVIDER_H_
+#define UI_VIEWS_TEST_TEST_LAYOUT_PROVIDER_H_
+
+#include <map>
+
+#include "base/macros.h"
+#include "ui/views/layout/layout_provider.h"
+
+namespace views {
+namespace test {
+
+// Helper to test LayoutProvider overrides.
+class TestLayoutProvider : public LayoutProvider {
+ public:
+ TestLayoutProvider();
+ ~TestLayoutProvider() override;
+
+ // Override requests for the |metric| DistanceMetric to return |value| rather
+ // than the default.
+ void SetDistanceMetric(int metric, int value);
+
+ // Override the return value of GetSnappedDialogWidth().
+ void SetSnappedDialogWidth(int width);
+
+ // LayoutProvider:
+ int GetDistanceMetric(int metric) const override;
+ int GetSnappedDialogWidth(int min_width) const override;
+
+ private:
+ std::map<int, int> distance_metrics_;
+ int snapped_dialog_width_ = 0;
+
+ DISALLOW_COPY_AND_ASSIGN(TestLayoutProvider);
+};
+
+} // namespace test
+} // namespace views
+
+#endif // UI_VIEWS_TEST_TEST_LAYOUT_PROVIDER_H_
« 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