Chromium Code Reviews| Index: chrome/browser/ui/views/hung_renderer_view.cc |
| diff --git a/chrome/browser/ui/views/hung_renderer_view.cc b/chrome/browser/ui/views/hung_renderer_view.cc |
| index 94bfedc9f3a3634a9b0c4a28c8ffee58191b8777..1f5d71ec0b42651664a27d66731d43d9f4b15215 100644 |
| --- a/chrome/browser/ui/views/hung_renderer_view.cc |
| +++ b/chrome/browser/ui/views/hung_renderer_view.cc |
| @@ -14,6 +14,8 @@ |
| #include "chrome/browser/ui/chrome_web_modal_dialog_manager_delegate.h" |
| #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
| #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" |
| +#include "chrome/browser/ui/views/harmony/layout_delegate.h" |
| +#include "chrome/browser/ui/views/layout_utils.h" |
| #include "chrome/common/chrome_constants.h" |
| #include "chrome/common/crash_keys.h" |
| #include "chrome/common/logging_chrome.h" |
| @@ -34,7 +36,6 @@ |
| #include "ui/views/controls/image_view.h" |
| #include "ui/views/controls/label.h" |
| #include "ui/views/layout/grid_layout.h" |
| -#include "ui/views/layout/layout_constants.h" |
| #include "ui/views/widget/widget.h" |
| #include "ui/views/window/client_view.h" |
| @@ -176,11 +177,6 @@ gfx::ImageSkia* HungRendererDialogView::frozen_icon_ = NULL; |
| static const int kTableViewWidth = 300; |
| static const int kTableViewHeight = 100; |
| -// Padding space in pixels between frozen icon to the info label, hung pages |
| -// list table view and the Kill pages button. |
| -static const int kCentralColumnPadding = |
| - views::kUnrelatedControlLargeHorizontalSpacing; |
| - |
| /////////////////////////////////////////////////////////////////////////////// |
| // HungRendererDialogView, public: |
| @@ -350,6 +346,12 @@ views::View* HungRendererDialogView::CreateExtraView() { |
| return kill_button_; |
| } |
| +bool HungRendererDialogView::GroupExtraViewWithButtons() const { |
| + // In harmony the kill button looks like a dialog button, but still doesn't |
| + // respond to accelerator keys, so it remains an extra view. |
| + return LayoutDelegate::Get()->IsHarmonyMode(); |
|
Peter Kasting
2017/02/06 21:44:50
After the previous discussion, I feel like we shou
Bret
2017/02/09 00:49:49
Done. I made the Wait button OK and the Kill butto
|
| +} |
| + |
| bool HungRendererDialogView::Cancel() { |
| // Start waiting again for responsiveness. |
| if (!kill_button_clicked_ && |
| @@ -443,14 +445,17 @@ void HungRendererDialogView::Init() { |
| using views::GridLayout; |
| using views::ColumnSet; |
| - GridLayout* layout = GridLayout::CreatePanel(this); |
| - SetLayoutManager(layout); |
| + GridLayout* layout = layout_utils::CreatePanelLayout(this); |
| + LayoutDelegate* delegate = LayoutDelegate::Get(); |
| const int double_column_set_id = 0; |
| ColumnSet* column_set = layout->AddColumnSet(double_column_set_id); |
| column_set->AddColumn(GridLayout::LEADING, GridLayout::LEADING, 0, |
| GridLayout::FIXED, frozen_icon_->width(), 0); |
| - column_set->AddPaddingColumn(0, kCentralColumnPadding); |
| + column_set->AddPaddingColumn( |
| + 0, delegate->GetMetric( |
| + LayoutDelegate::Metric:: |
| + UNRELATED_CONTROL_HORIZONTAL_SPACING_LARGE)); |
| column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, 1, |
| GridLayout::USE_PREF, 0, 0); |
| @@ -461,7 +466,9 @@ void HungRendererDialogView::Init() { |
| layout->AddView( |
| info_label_, 1, 1, GridLayout::FILL, GridLayout::LEADING, 1, 0); |
| - layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
| + layout->AddPaddingRow( |
| + 0, delegate->GetMetric(LayoutDelegate::Metric:: |
| + RELATED_CONTROL_VERTICAL_SPACING)); |
| layout->StartRow(0, double_column_set_id); |
| layout->SkipColumns(1); |