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
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 @@
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);