| OLD | NEW |
| 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 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 adding_view_(false) { | 646 adding_view_(false) { |
| 647 DCHECK(host); | 647 DCHECK(host); |
| 648 } | 648 } |
| 649 | 649 |
| 650 GridLayout::~GridLayout() { | 650 GridLayout::~GridLayout() { |
| 651 } | 651 } |
| 652 | 652 |
| 653 // static | 653 // static |
| 654 GridLayout* GridLayout::CreatePanel(View* host) { | 654 GridLayout* GridLayout::CreatePanel(View* host) { |
| 655 GridLayout* layout = new GridLayout(host); | 655 GridLayout* layout = new GridLayout(host); |
| 656 host->SetBorder( | 656 host->SetBorder(CreateEmptyBorder( |
| 657 CreateEmptyBorder(LayoutProvider::Get()->GetInsetsMetric(INSETS_PANEL))); | 657 LayoutProvider::Get()->GetInsetsMetric(INSETS_DIALOG_CONTENTS))); |
| 658 host->SetLayoutManager(layout); | 658 host->SetLayoutManager(layout); |
| 659 return layout; | 659 return layout; |
| 660 } | 660 } |
| 661 | 661 |
| 662 ColumnSet* GridLayout::AddColumnSet(int id) { | 662 ColumnSet* GridLayout::AddColumnSet(int id) { |
| 663 DCHECK(GetColumnSet(id) == nullptr); | 663 DCHECK(GetColumnSet(id) == nullptr); |
| 664 column_sets_.push_back(base::WrapUnique(new ColumnSet(id))); | 664 column_sets_.push_back(base::WrapUnique(new ColumnSet(id))); |
| 665 return column_sets_.back().get(); | 665 return column_sets_.back().get(); |
| 666 } | 666 } |
| 667 | 667 |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1023 | 1023 |
| 1024 ColumnSet* GridLayout::GetLastValidColumnSet() { | 1024 ColumnSet* GridLayout::GetLastValidColumnSet() { |
| 1025 for (int i = current_row_ - 1; i >= 0; --i) { | 1025 for (int i = current_row_ - 1; i >= 0; --i) { |
| 1026 if (rows_[i]->column_set()) | 1026 if (rows_[i]->column_set()) |
| 1027 return rows_[i]->column_set(); | 1027 return rows_[i]->column_set(); |
| 1028 } | 1028 } |
| 1029 return nullptr; | 1029 return nullptr; |
| 1030 } | 1030 } |
| 1031 | 1031 |
| 1032 } // namespace views | 1032 } // namespace views |
| OLD | NEW |