OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 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 VIEWS_LAYOUT_CENTER_LAYOUT_H_ |
| 6 #define VIEWS_LAYOUT_CENTER_LAYOUT_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "views/layout/layout_manager.h" |
| 10 #include "views/view.h" |
| 11 |
| 12 namespace gfx { |
| 13 class Size; |
| 14 } |
| 15 |
| 16 namespace views { |
| 17 |
| 18 // A layout manager that layouts a single child at the center of the host view. |
| 19 // The child's size is limited by the host's local bounds and insets. |
| 20 class VIEWS_EXPORT CenterLayout : public LayoutManager { |
| 21 public: |
| 22 CenterLayout(); |
| 23 virtual ~CenterLayout(); |
| 24 |
| 25 // Overridden from LayoutManager: |
| 26 virtual void Layout(View* host) OVERRIDE; |
| 27 virtual gfx::Size GetPreferredSize(View* host) OVERRIDE; |
| 28 virtual int GetPreferredHeightForWidth(View* host, int width) OVERRIDE; |
| 29 |
| 30 private: |
| 31 DISALLOW_COPY_AND_ASSIGN(CenterLayout); |
| 32 }; |
| 33 |
| 34 } // namespace views |
| 35 |
| 36 #endif // VIEWS_LAYOUT_CENTER_LAYOUT_H_ |
OLD | NEW |