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

Side by Side Diff: ui/views/layout/grid_layout.cc

Issue 2126433002: Use container::back() and container::pop_back() in ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pre-increment Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « ui/views/controls/textfield/textfield_model.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/layout/grid_layout.h" 5 #include "ui/views/layout/grid_layout.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after
930 UpdateRemainingHeightFromRows(view_state); 930 UpdateRemainingHeightFromRows(view_state);
931 931
932 // Distribute the remaining height. 932 // Distribute the remaining height.
933 DistributeRemainingHeight(view_state); 933 DistributeRemainingHeight(view_state);
934 } 934 }
935 935
936 // Update the location of each of the rows. 936 // Update the location of each of the rows.
937 LayoutElement::CalculateLocationsFromSize(&rows_); 937 LayoutElement::CalculateLocationsFromSize(&rows_);
938 938
939 // We now know the preferred height, set it here. 939 // We now know the preferred height, set it here.
940 pref->set_height(rows_[rows_.size() - 1]->Location() + 940 pref->set_height(rows_.back()->Location() + rows_.back()->Size() +
941 rows_[rows_.size() - 1]->Size() + insets_.height()); 941 insets_.height());
942 942
943 if (layout && height != pref->height()) { 943 if (layout && height != pref->height()) {
944 // We're doing a layout, and the height differs from the preferred height, 944 // We're doing a layout, and the height differs from the preferred height,
945 // divy up the extra space. 945 // divy up the extra space.
946 LayoutElement::DistributeDelta(height - pref->height(), &rows_); 946 LayoutElement::DistributeDelta(height - pref->height(), &rows_);
947 947
948 // Reset y locations. 948 // Reset y locations.
949 LayoutElement::CalculateLocationsFromSize(&rows_); 949 LayoutElement::CalculateLocationsFromSize(&rows_);
950 } 950 }
951 } 951 }
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1055 1055
1056 ColumnSet* GridLayout::GetLastValidColumnSet() { 1056 ColumnSet* GridLayout::GetLastValidColumnSet() {
1057 for (int i = current_row_ - 1; i >= 0; --i) { 1057 for (int i = current_row_ - 1; i >= 0; --i) {
1058 if (rows_[i]->column_set()) 1058 if (rows_[i]->column_set())
1059 return rows_[i]->column_set(); 1059 return rows_[i]->column_set();
1060 } 1060 }
1061 return NULL; 1061 return NULL;
1062 } 1062 }
1063 1063
1064 } // namespace views 1064 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/textfield/textfield_model.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698