From cc40648ba7ced82ecf923475ddcaca4e690408b8 Mon Sep 17 00:00:00 2001 From: "tfarina@chromium.org" Date: Wed, 26 Jan 2011 01:52:08 +0000 Subject: views: Forward declare "class View;" in layout_manager.h And move the include of views/view.h from the header to the source file. BUG=None TEST=trybots Review URL: http://codereview.chromium.org/6332013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72587 0039d316-1c4b-4281-b951-d872f2087c98 --- views/layout/box_layout.cc | 7 +++++++ views/layout/box_layout.h | 13 ++++++++++--- views/layout/layout_manager.cc | 2 ++ views/layout/layout_manager.h | 4 ++-- 4 files changed, 21 insertions(+), 5 deletions(-) (limited to 'views/layout') diff --git a/views/layout/box_layout.cc b/views/layout/box_layout.cc index 5025d7e..6a6ede6 100644 --- a/views/layout/box_layout.cc +++ b/views/layout/box_layout.cc @@ -4,6 +4,10 @@ #include "views/layout/box_layout.h" +#include "gfx/insets.h" +#include "gfx/rect.h" +#include "views/view.h" + namespace views { BoxLayout::BoxLayout(BoxLayout::Orientation orientation, @@ -16,6 +20,9 @@ BoxLayout::BoxLayout(BoxLayout::Orientation orientation, between_child_spacing_(between_child_spacing) { } +BoxLayout::~BoxLayout() { +} + void BoxLayout::Layout(View* host) { gfx::Rect childArea(gfx::Rect(host->size())); childArea.Inset(host->GetInsets()); diff --git a/views/layout/box_layout.h b/views/layout/box_layout.h index fde203c..e2910b4 100644 --- a/views/layout/box_layout.h +++ b/views/layout/box_layout.h @@ -7,10 +7,17 @@ #pragma once #include "base/basictypes.h" +#include "base/compiler_specific.h" #include "views/layout/layout_manager.h" +namespace gfx { +class Size; +} + namespace views { +class View; + // 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 @@ -31,11 +38,11 @@ class BoxLayout : public LayoutManager { int inside_border_horizontal_spacing, int inside_border_vertical_spacing, int between_child_spacing); - virtual ~BoxLayout() {} + virtual ~BoxLayout(); // Overridden from views::LayoutManager: - virtual void Layout(View* host); - virtual gfx::Size GetPreferredSize(View* host); + virtual void Layout(View* host) OVERRIDE; + virtual gfx::Size GetPreferredSize(View* host) OVERRIDE; private: const Orientation orientation_; diff --git a/views/layout/layout_manager.cc b/views/layout/layout_manager.cc index adaad9f..c62c6bb 100644 --- a/views/layout/layout_manager.cc +++ b/views/layout/layout_manager.cc @@ -4,6 +4,8 @@ #include "views/layout/layout_manager.h" +#include "views/view.h" + namespace views { LayoutManager::~LayoutManager() { diff --git a/views/layout/layout_manager.h b/views/layout/layout_manager.h index 328238a..3fb99c1 100644 --- a/views/layout/layout_manager.h +++ b/views/layout/layout_manager.h @@ -6,14 +6,14 @@ #define VIEWS_LAYOUT_MANAGER_H_ #pragma once -#include "views/view.h" - namespace gfx { class Size; } namespace views { +class View; + ///////////////////////////////////////////////////////////////////////////// // // LayoutManager interface -- cgit v1.1