| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "views/grid_layout.h" | 5 #include "views/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 "views/standard_layout.h" |
| 10 #include "views/view.h" | 11 #include "views/view.h" |
| 11 | 12 |
| 12 namespace views { | 13 namespace views { |
| 13 | 14 |
| 14 // LayoutElement ------------------------------------------------------ | 15 // LayoutElement ------------------------------------------------------ |
| 15 | 16 |
| 16 // A LayoutElement has a size and location along one axis. It contains | 17 // A LayoutElement has a size and location along one axis. It contains |
| 17 // methods that are used along both axis. | 18 // methods that are used along both axis. |
| 18 class LayoutElement { | 19 class LayoutElement { |
| 19 public: | 20 public: |
| (...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1004 | 1005 |
| 1005 ColumnSet* GridLayout::GetLastValidColumnSet() { | 1006 ColumnSet* GridLayout::GetLastValidColumnSet() { |
| 1006 for (int i = current_row_ - 1; i >= 0; --i) { | 1007 for (int i = current_row_ - 1; i >= 0; --i) { |
| 1007 if (rows_[i]->column_set()) | 1008 if (rows_[i]->column_set()) |
| 1008 return rows_[i]->column_set(); | 1009 return rows_[i]->column_set(); |
| 1009 } | 1010 } |
| 1010 return NULL; | 1011 return NULL; |
| 1011 } | 1012 } |
| 1012 | 1013 |
| 1013 } // namespace views | 1014 } // namespace views |
| 1015 |
| 1016 views::GridLayout* CreatePanelGridLayout(views::View* host) { |
| 1017 views::GridLayout* layout = new views::GridLayout(host); |
| 1018 layout->SetInsets(kPanelVertMargin, kPanelHorizMargin, |
| 1019 kPanelVertMargin, kPanelHorizMargin); |
| 1020 return layout; |
| 1021 } |
| 1022 |
| OLD | NEW |