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

Side by Side Diff: chrome/browser/ui/views/extensions/extension_install_dialog_view.cc

Issue 2859193004: Remove GridLayout::SetInsets in favor of an empty border on the host. (Closed)
Patch Set: missed a merge problem 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 "chrome/browser/ui/views/extensions/extension_install_dialog_view.h" 5 #include "chrome/browser/ui/views/extensions/extension_install_dialog_view.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 const int bottom_margin = 449 const int bottom_margin =
450 provider->GetDistanceMetric(DISTANCE_PANEL_CONTENT_MARGIN); 450 provider->GetDistanceMetric(DISTANCE_PANEL_CONTENT_MARGIN);
451 451
452 // This is views::GridLayout::CreatePanel(), but without a top or right 452 // This is views::GridLayout::CreatePanel(), but without a top or right
453 // margin. The empty dialog title will then become the top margin, and a 453 // margin. The empty dialog title will then become the top margin, and a
454 // padding column will be manually added to handle a right margin. This is 454 // padding column will be manually added to handle a right margin. This is
455 // done so that the extension icon can be shown on the right of the dialog 455 // done so that the extension icon can be shown on the right of the dialog
456 // title, but on the same y-axis, and the scroll view used to contain other 456 // title, but on the same y-axis, and the scroll view used to contain other
457 // content can have its scrollbar aligned with the right edge of the dialog. 457 // content can have its scrollbar aligned with the right edge of the dialog.
458 views::GridLayout* layout = new views::GridLayout(container_); 458 views::GridLayout* layout = new views::GridLayout(container_);
459 layout->SetInsets(0, horizontal_margin, bottom_margin, 0);
460 container_->SetLayoutManager(layout); 459 container_->SetLayoutManager(layout);
460 container_->SetBorder(
461 views::CreateEmptyBorder(0, horizontal_margin, bottom_margin, 0));
461 AddChildView(container_); 462 AddChildView(container_);
462 463
463 views::ColumnSet* column_set = layout->AddColumnSet(column_set_id); 464 views::ColumnSet* column_set = layout->AddColumnSet(column_set_id);
464 column_set->AddColumn(views::GridLayout::LEADING, views::GridLayout::LEADING, 465 column_set->AddColumn(views::GridLayout::LEADING, views::GridLayout::LEADING,
465 0, // no resizing 466 0, // no resizing
466 views::GridLayout::USE_PREF, 467 views::GridLayout::USE_PREF,
467 0, // no fixed width 468 0, // no fixed width
468 left_column_width); 469 left_column_width);
469 column_set->AddPaddingColumn( 470 column_set->AddPaddingColumn(
470 0, provider->GetDistanceMetric(DISTANCE_UNRELATED_CONTROL_HORIZONTAL)); 471 0, provider->GetDistanceMetric(DISTANCE_UNRELATED_CONTROL_HORIZONTAL));
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 gfx::ImageSkia icon = gfx::CreateVectorIcon( 790 gfx::ImageSkia icon = gfx::CreateVectorIcon(
790 expanded ? kCaretUpIcon : kCaretDownIcon, gfx::kChromeIconGrey); 791 expanded ? kCaretUpIcon : kCaretDownIcon, gfx::kChromeIconGrey);
791 arrow_toggle_->SetImage(views::Button::STATE_NORMAL, &icon); 792 arrow_toggle_->SetImage(views::Button::STATE_NORMAL, &icon);
792 } 793 }
793 794
794 // static 795 // static
795 ExtensionInstallPrompt::ShowDialogCallback 796 ExtensionInstallPrompt::ShowDialogCallback
796 ExtensionInstallPrompt::GetViewsShowDialogCallback() { 797 ExtensionInstallPrompt::GetViewsShowDialogCallback() {
797 return base::Bind(&ShowExtensionInstallDialogImpl); 798 return base::Bind(&ShowExtensionInstallDialogImpl);
798 } 799 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698