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

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

Issue 2439093002: Reland of "Added common layout framework for system menu rows." (Closed)
Patch Set: Addressed review comments. Created 4 years, 1 month 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/BUILD.gn ('k') | ui/views/test/test_layout_manager.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 2016 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_MANAGER_H_
6 #define UI_VIEWS_TEST_TEST_LAYOUT_MANAGER_H_
7
8 #include "ui/gfx/geometry/size.h"
9 #include "ui/views/layout/layout_manager.h"
10
11 namespace views {
12 namespace test {
13
14 // A stub layout manager that returns a specific preferred size and height for
15 // width.
16 class TestLayoutManager : public LayoutManager {
17 public:
18 TestLayoutManager();
19 ~TestLayoutManager() override;
20
21 void set_preferred_size(const gfx::Size& size) { preferred_size_ = size; }
22
23 void set_preferred_height_for_width(int height) {
24 preferred_height_for_width_ = height;
25 }
26
27 // LayoutManager:
28 void Layout(View* host) override;
29 gfx::Size GetPreferredSize(const View* host) const override;
30 int GetPreferredHeightForWidth(const View* host, int width) const override;
31
32 private:
33 // The return value of GetPreferredSize();
34 gfx::Size preferred_size_;
35
36 // The return value for GetPreferredHeightForWidth().
37 int preferred_height_for_width_ = 0;
38
39 DISALLOW_COPY_AND_ASSIGN(TestLayoutManager);
40 };
41
42 } // namespace test
43 } // namespace views
44
45 #endif // UI_VIEWS_TEST_TEST_LAYOUT_MANAGER_H_
OLDNEW
« no previous file with comments | « ui/views/BUILD.gn ('k') | ui/views/test/test_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698