Index: chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc |
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc |
index d2d718ffef48d9a1c5e167725d26224e9aba3c51..26fce79b753313cce4d94ca07998445cf3655761 100644 |
--- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc |
+++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc |
@@ -7,15 +7,18 @@ |
#include "base/memory/scoped_ptr.h" |
#include "chrome/browser/ui/app_list/app_list_controller_delegate.h" |
#include "chrome/browser/ui/views/app_list/app_list_dialog_contents_view.h" |
+#include "chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.h" |
#include "chrome/browser/ui/views/apps/app_info_dialog/app_info_header_panel.h" |
#include "chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.h" |
#include "chrome/browser/ui/views/apps/app_info_dialog/app_info_summary_panel.h" |
#include "chrome/browser/ui/views/constrained_window_views.h" |
+#include "ui/app_list/app_list_constants.h" |
#include "ui/gfx/geometry/rect.h" |
#include "ui/gfx/geometry/size.h" |
#include "ui/views/border.h" |
#include "ui/views/controls/scroll_view.h" |
#include "ui/views/layout/box_layout.h" |
+#include "ui/views/layout/grid_layout.h" |
#include "ui/views/layout/layout_constants.h" |
#include "ui/views/widget/widget.h" |
@@ -36,41 +39,59 @@ void ShowAppInfoDialog(AppListControllerDelegate* app_list_controller_delegate, |
dialog_widget->Show(); |
} |
-AppInfoDialog::AppInfoDialog(Profile* profile, |
- const extensions::Extension* app) { |
- // The width of this margin determines the spacing either side of the |
- // horizontal separator underneath the summary panel. |
- const int kHorizontalBorderSpacing = 1; |
- const int kHorizontalSeparatorHeight = 2; |
- SetLayoutManager(new views::BoxLayout( |
- views::BoxLayout::kVertical, kHorizontalBorderSpacing, 0, 0)); |
- AppInfoHeaderPanel* dialog_header = new AppInfoHeaderPanel(profile, app); |
- dialog_header->SetBorder(views::Border::CreateSolidSidedBorder( |
- 0, 0, kHorizontalSeparatorHeight, 0, SK_ColorLTGRAY)); |
+AppInfoDialog::AppInfoDialog(Profile* profile, const extensions::Extension* app) |
+ : dialog_header_(NULL), dialog_body_(NULL), dialog_footer_(NULL) { |
+ views::GridLayout* layout = new views::GridLayout(this); |
+ SetLayoutManager(layout); |
+ |
+ // Create one column that fills the whole dialog. |
+ int kColumnSetId = 1; |
+ views::ColumnSet* column_set = layout->AddColumnSet(kColumnSetId); |
+ column_set->AddColumn(views::GridLayout::FILL, |
+ views::GridLayout::FILL, |
+ 1, // Stretch the column to the width of the dialog. |
+ views::GridLayout::USE_PREF, |
+ 0, |
+ 0); |
+ |
+ const int kHorizontalSeparatorHeight = 1; |
+ dialog_header_ = new AppInfoHeaderPanel(profile, app); |
+ dialog_header_->SetBorder(views::Border::CreateSolidSidedBorder( |
+ 0, 0, kHorizontalSeparatorHeight, 0, app_list::kDialogSeparatorColor)); |
+ |
+ dialog_footer_ = new AppInfoFooterPanel(profile, app); |
+ dialog_footer_->SetBorder(views::Border::CreateSolidSidedBorder( |
+ kHorizontalSeparatorHeight, 0, 0, 0, app_list::kDialogSeparatorColor)); |
// Make a vertically stacked view of all the panels we want to display in the |
// dialog. |
- views::View* dialog_body = new views::View(); |
- dialog_body->SetLayoutManager( |
+ views::View* dialog_body_contents = new views::View(); |
+ dialog_body_contents->SetLayoutManager( |
new views::BoxLayout(views::BoxLayout::kVertical, |
views::kButtonHEdgeMarginNew, |
views::kPanelVertMargin, |
views::kUnrelatedControlVerticalSpacing)); |
- dialog_body->AddChildView(new AppInfoSummaryPanel(profile, app)); |
- dialog_body->AddChildView(new AppInfoPermissionsPanel(profile, app)); |
+ dialog_body_contents->AddChildView(new AppInfoSummaryPanel(profile, app)); |
+ dialog_body_contents->AddChildView(new AppInfoPermissionsPanel(profile, app)); |
// Clip the scrollable view so that the scrollbar appears. As long as this |
// is larger than the height of the dialog, it will be resized to the dialog's |
// actual height. |
// TODO(sashab): Add ClipHeight() as a parameter-less method to |
- // views::ScrollView(), which mimics this behaviour. |
+ // views::ScrollView() to mimic this behaviour. |
const int kMaxDialogHeight = 1000; |
- views::ScrollView* dialog_body_scrollview = new views::ScrollView(); |
- dialog_body_scrollview->ClipHeightTo(kMaxDialogHeight, kMaxDialogHeight); |
- dialog_body_scrollview->SetContents(dialog_body); |
+ dialog_body_ = new views::ScrollView(); |
+ dialog_body_->ClipHeightTo(kMaxDialogHeight, kMaxDialogHeight); |
+ dialog_body_->SetContents(dialog_body_contents); |
+ |
+ layout->StartRow(0, kColumnSetId); |
+ layout->AddView(dialog_header_); |
+ |
+ layout->StartRow(1, kColumnSetId); |
+ layout->AddView(dialog_body_); |
- AddChildView(dialog_header); |
- AddChildView(dialog_body_scrollview); |
+ layout->StartRow(0, kColumnSetId); |
+ layout->AddView(dialog_footer_); |
} |
AppInfoDialog::~AppInfoDialog() { |