diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-21 12:52:29 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-21 12:52:29 +0000 |
commit | 8d0f80014579e4763286b9d4779a9c79d16cd132 (patch) | |
tree | 9960516820b0c0c6da24644f0c68245d4ee8a2cb /views | |
parent | 3846fb2460ddb4914193428e5f8f5c6c9826740c (diff) | |
download | chromium_src-8d0f80014579e4763286b9d4779a9c79d16cd132.zip chromium_src-8d0f80014579e4763286b9d4779a9c79d16cd132.tar.gz chromium_src-8d0f80014579e4763286b9d4779a9c79d16cd132.tar.bz2 |
views: Make CreatePanelGridLayout a static method of GridLayout class.
Move it from standard_layout.h and rename to just CreatePanel.
BUG=None
TEST=trybots
Review URL: http://codereview.chromium.org/6384002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72128 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/controls/message_box_view.cc | 4 | ||||
-rw-r--r-- | views/grid_layout.cc | 17 | ||||
-rw-r--r-- | views/grid_layout.h | 5 | ||||
-rw-r--r-- | views/standard_layout.h | 5 |
4 files changed, 16 insertions, 15 deletions
diff --git a/views/controls/message_box_view.cc b/views/controls/message_box_view.cc index a239a16..2023ca4 100644 --- a/views/controls/message_box_view.cc +++ b/views/controls/message_box_view.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -150,7 +150,7 @@ void MessageBoxView::ResetLayoutManager() { using views::ColumnSet; // Initialize the Grid Layout Manager used for this dialog box. - GridLayout* layout = CreatePanelGridLayout(this); + GridLayout* layout = GridLayout::CreatePanel(this); SetLayoutManager(layout); gfx::Size icon_size; diff --git a/views/grid_layout.cc b/views/grid_layout.cc index 5e685ac..b01247f 100644 --- a/views/grid_layout.cc +++ b/views/grid_layout.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -676,6 +676,14 @@ GridLayout::~GridLayout() { STLDeleteElements(&rows_); } +// static +GridLayout* GridLayout::CreatePanel(View* host) { + GridLayout* layout = new GridLayout(host); + layout->SetInsets(kPanelVertMargin, kPanelHorizMargin, + kPanelVertMargin, kPanelHorizMargin); + return layout; +} + void GridLayout::SetInsets(int top, int left, int bottom, int right) { top_inset_ = top; bottom_inset_ = bottom; @@ -1060,10 +1068,3 @@ ColumnSet* GridLayout::GetLastValidColumnSet() { } } // namespace views - -views::GridLayout* CreatePanelGridLayout(views::View* host) { - views::GridLayout* layout = new views::GridLayout(host); - layout->SetInsets(kPanelVertMargin, kPanelHorizMargin, - kPanelVertMargin, kPanelHorizMargin); - return layout; -} diff --git a/views/grid_layout.h b/views/grid_layout.h index a1574ce..bfbfa64 100644 --- a/views/grid_layout.h +++ b/views/grid_layout.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -105,6 +105,9 @@ class GridLayout : public LayoutManager { explicit GridLayout(View* host); virtual ~GridLayout(); + // Creates a GridLayout with kPanel*Margin insets. + static GridLayout* CreatePanel(View* host); + // Sets the insets. All views are placed relative to these offsets. void SetInsets(int top, int left, int bottom, int right); void SetInsets(const gfx::Insets& insets); diff --git a/views/standard_layout.h b/views/standard_layout.h index 9679289..96d36fe 100644 --- a/views/standard_layout.h +++ b/views/standard_layout.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -67,7 +67,4 @@ const int kButtonHEdgeMargin = 7; // Horizontal spacing between buttons that are logically related. const int kRelatedButtonHSpacing = 6; -// Creates a GridLayout with kPanel*Margin insets. -views::GridLayout* CreatePanelGridLayout(views::View* host); - #endif // VIEWS_STANDARD_LAYOUT_H_ |