diff options
author | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-23 08:56:20 +0000 |
---|---|---|
committer | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-23 08:56:20 +0000 |
commit | 3a483454db080bfbc2d0a7ce4daa445ce9b3d2cd (patch) | |
tree | 202909ab5a600c78e94ad381e3e277ea1ea1a27a /views/grid_layout.cc | |
parent | 654e5bbe0948dcb686d7ecb50def3a2a729e8ddb (diff) | |
download | chromium_src-3a483454db080bfbc2d0a7ce4daa445ce9b3d2cd.zip chromium_src-3a483454db080bfbc2d0a7ce4daa445ce9b3d2cd.tar.gz chromium_src-3a483454db080bfbc2d0a7ce4daa445ce9b3d2cd.tar.bz2 |
Add GridLayout::SetInsets(const gfx::Insets& insets).
Per the style guide, function overloading like this is allowed.
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Function_Overloading#Function_Overloading
I wanted this API so I could define and use a constant like:
const gfx::Insets kSomeInsets(1, 2, 3, 4);
layout->SetInsets(kSomeInsets);
BUG=none
TEST=try
Review URL: http://codereview.chromium.org/509027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35209 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/grid_layout.cc')
-rw-r--r-- | views/grid_layout.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/views/grid_layout.cc b/views/grid_layout.cc index d35f42f..9b44372 100644 --- a/views/grid_layout.cc +++ b/views/grid_layout.cc @@ -7,6 +7,7 @@ #include <algorithm> #include "base/logging.h" +#include "app/gfx/insets.h" #include "views/standard_layout.h" #include "views/view.h" @@ -690,6 +691,10 @@ void GridLayout::SetInsets(int top, int left, int bottom, int right) { right_inset_ = right; } +void GridLayout::SetInsets(const gfx::Insets& insets) { + SetInsets(insets.top(), insets.left(), insets.bottom(), insets.right()); +} + ColumnSet* GridLayout::AddColumnSet(int id) { DCHECK(GetColumnSet(id) == NULL); ColumnSet* column_set = new ColumnSet(id); |