Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1134)

Unified Diff: ui/views/layout/grid_layout.cc

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More compile fix for ToT Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/layout/grid_layout.h ('k') | ui/views/layout/grid_layout_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/layout/grid_layout.cc
diff --git a/ui/views/layout/grid_layout.cc b/ui/views/layout/grid_layout.cc
index e28a1b723547e0b8b401a60b6c9555b708b236ce..7ab81083c34bb9609179085e30d3fb555c2aaf26 100644
--- a/ui/views/layout/grid_layout.cc
+++ b/ui/views/layout/grid_layout.cc
@@ -828,7 +828,7 @@ void GridLayout::Layout(View* host) {
}
}
-gfx::Size GridLayout::GetPreferredSize(View* host) {
+gfx::Size GridLayout::GetPreferredSize(const View* host) const {
DCHECK(host_ == host);
gfx::Size out;
SizeRowsAndColumns(false, 0, 0, &out);
@@ -837,7 +837,7 @@ gfx::Size GridLayout::GetPreferredSize(View* host) {
return out;
}
-int GridLayout::GetPreferredHeightForWidth(View* host, int width) {
+int GridLayout::GetPreferredHeightForWidth(const View* host, int width) const {
DCHECK(host_ == host);
gfx::Size pref;
SizeRowsAndColumns(false, width, 0, &pref);
@@ -845,7 +845,7 @@ int GridLayout::GetPreferredHeightForWidth(View* host, int width) {
}
void GridLayout::SizeRowsAndColumns(bool layout, int width, int height,
- gfx::Size* pref) {
+ gfx::Size* pref) const {
// Make sure the master columns have been calculated.
CalculateMasterColumnsIfNecessary();
pref->SetSize(0, 0);
@@ -950,7 +950,7 @@ void GridLayout::SizeRowsAndColumns(bool layout, int width, int height,
}
}
-void GridLayout::CalculateMasterColumnsIfNecessary() {
+void GridLayout::CalculateMasterColumnsIfNecessary() const {
if (!calculated_master_columns_) {
calculated_master_columns_ = true;
for (std::vector<ColumnSet*>::iterator i = column_sets_.begin();
@@ -995,14 +995,14 @@ void GridLayout::AddRow(Row* row) {
SkipPaddingColumns();
}
-void GridLayout::UpdateRemainingHeightFromRows(ViewState* view_state) {
+void GridLayout::UpdateRemainingHeightFromRows(ViewState* view_state) const {
for (int i = 0, start_row = view_state->start_row;
i < view_state->row_span; ++i) {
view_state->remaining_height -= rows_[i + start_row]->Size();
}
}
-void GridLayout::DistributeRemainingHeight(ViewState* view_state) {
+void GridLayout::DistributeRemainingHeight(ViewState* view_state) const {
int height = view_state->remaining_height;
if (height <= 0)
return;
« no previous file with comments | « ui/views/layout/grid_layout.h ('k') | ui/views/layout/grid_layout_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698