summaryrefslogtreecommitdiffstats
path: root/views/box_layout.h
diff options
context:
space:
mode:
authormnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-06 07:48:58 +0000
committermnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-06 07:48:58 +0000
commit0af29d8cedd97d4604619dd4ab2b5e0a0805ecb1 (patch)
tree3c9f00670a268464b963443a7de96728fb32e0be /views/box_layout.h
parent6e094094ed8b96e68b30e8628e8a169719edda27 (diff)
downloadchromium_src-0af29d8cedd97d4604619dd4ab2b5e0a0805ecb1.zip
chromium_src-0af29d8cedd97d4604619dd4ab2b5e0a0805ecb1.tar.gz
chromium_src-0af29d8cedd97d4604619dd4ab2b5e0a0805ecb1.tar.bz2
Display warning banner in Win preferences dialog for managed options.
BUG=43423 TEST=box_layout_unittest.cc, manual UI tests. Review URL: http://codereview.chromium.org/2738002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51655 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/box_layout.h')
-rw-r--r--views/box_layout.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/views/box_layout.h b/views/box_layout.h
new file mode 100644
index 0000000..332be47
--- /dev/null
+++ b/views/box_layout.h
@@ -0,0 +1,50 @@
+// Copyright (c) 2010 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 VIEWS_BOX_LAYOUT_H_
+#define VIEWS_BOX_LAYOUT_H_
+
+#include "base/basictypes.h"
+#include "views/layout_manager.h"
+
+namespace views {
+
+// A Layout manager that arranges child views vertically or horizontally in a
+// side-by-side fashion with spacing around and between the child views. The
+// child views are always sized according to their preferred size. If the
+// host's bounds provide insufficient space, child views will be clamped.
+// Excess space will not be distributed.
+class BoxLayout : public LayoutManager {
+ public:
+ enum Orientation {
+ kHorizontal,
+ kVertical,
+ };
+
+ // Use |inside_border_spacing| to add additional space between the child view
+ // area and the host view border. |between_child_spacing| controls the space
+ // in between child views.
+ BoxLayout(Orientation orientation,
+ int inside_border_spacing,
+ int between_child_spacing);
+ virtual ~BoxLayout() {}
+
+ // Overridden from views::LayoutManager:
+ virtual void Layout(View* host);
+ virtual gfx::Size GetPreferredSize(View* host);
+
+ private:
+ const Orientation orientation_;
+
+ // Spacing between child views and host view border.
+ const int inside_border_spacing_;
+ // Spacing to put in between child views.
+ const int between_child_spacing_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(BoxLayout);
+};
+
+} // namespace views
+
+#endif // VIEWS_BOX_LAYOUT_H_