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

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

Issue 2414103003: Added common layout framework for system menu rows. (Closed)
Patch Set: Merge branch 'master' into md_system_menu_layout_mgr Created 4 years, 2 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
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 #include "ui/views/views_export.h"
11
12 namespace views {
13 namespace test {
14
15 // A stub layout manager that returns a specific preferred size and height for
16 // width.
17 class VIEWS_EXPORT TestLayoutManager : public LayoutManager {
18 public:
19 TestLayoutManager();
20 ~TestLayoutManager() override;
21
22 void set_preferred_size(const gfx::Size& size) { preferred_size_ = size; }
23
24 void set_preferred_height_for_width(int height) {
25 preferred_height_for_width_ = height;
26 }
27
28 // LayoutManager:
29 void Layout(View* host) override;
30 gfx::Size GetPreferredSize(const View* host) const override;
31 int GetPreferredHeightForWidth(const View* host, int width) const override;
32
33 private:
34 // The return value of GetPreferredSize();
35 gfx::Size preferred_size_ = gfx::Size(0, 0);
36
37 // The return value for GetPreferredHeightForWidth().
38 int preferred_height_for_width_ = 0;
39
40 DISALLOW_COPY_AND_ASSIGN(TestLayoutManager);
41 };
42
43 } // namespace test
44 } // namespace views
45
46 #endif // UI_VIEWS_TEST_TEST_LAYOUT_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698