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

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

Issue 2888563004: Delete panel metrics and define insets in terms of distance metrics. (Closed)
Patch Set: one wrong conversion Created 3 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 unified diff | Download patch
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 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/webshare/webshare_target_picker_view.cc ('k') | ui/views/layout/layout_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698